Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 61 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,51 +96,67 @@ Below is a sample configuration:

## 🛠️ Available Tools

| Category | Tool Name | Description |
| ------------------------- | -------------------------- | ------------------------------------------------ |
| **Context & Setup** | `get_initial_context` | Initialize connection and get usage instructions |
| **Content Types** | `list_content_types` | List all content types |
| | `get_content_type` | Get detailed content type information |
| | `create_content_type` | Create new content types |
| | `update_content_type` | Modify existing content types |
| | `publish_content_type` | Publish content type changes |
| | `unpublish_content_type` | Unpublish content types |
| | `delete_content_type` | Remove content types |
| **Entries** | `search_entries` | Search and filter entries |
| | `get_entry` | Retrieve specific entries |
| | `create_entry` | Create new content entries |
| | `update_entry` | Modify existing entries |
| | `publish_entry` | Publish entries (single or bulk) |
| | `unpublish_entry` | Unpublish entries (single or bulk) |
| | `delete_entry` | Remove entries |
| **Assets** | `upload_asset` | Upload new assets |
| | `list_assets` | List and browse assets |
| | `get_asset` | Retrieve specific assets |
| | `update_asset` | Modify asset metadata |
| | `publish_asset` | Publish assets (single or bulk) |
| | `unpublish_asset` | Unpublish assets (single or bulk) |
| | `delete_asset` | Remove assets |
| **Spaces & Environments** | `list_spaces` | List available spaces |
| | `get_space` | Get space details |
| | `list_environments` | List environments |
| | `create_environment` | Create new environments |
| | `delete_environment` | Remove environments |
| **Locales** | `list_locales` | List all locales in your environment |
| | `get_locale` | Retrieve specific locale information |
| | `create_locale` | Create new locales for multi-language content |
| | `update_locale` | Modify existing locale settings |
| | `delete_locale` | Remove locales from environment |
| **Tags** | `list_tags` | List all tags |
| | `create_tag` | Create new tags |
| **AI Actions** | `create_ai_action` | Create custom AI-powered workflows |
| | `invoke_ai_action` | Invoke an AI action with variables |
| | `get_ai_action_invocation` | Get AI action invocation details |
| | `get_ai_action` | Retrieve AI action details and configuration |
| | `list_ai_actions` | List AI actions in a space |
| | `update_ai_action` | Update existing AI actions |
| | `publish_ai_action` | Publish AI actions for use |
| | `unpublish_ai_action` | Unpublish AI actions |
| | `delete_ai_action` | Remove AI actions |
| Category | Tool Name | Description |
| ------------------------- | ---------------------------------- | ------------------------------------------------ |
| **Context & Setup** | `get_initial_context` | Initialize connection and get usage instructions |
| **Content Types** | `list_content_types` | List content types (max 10 per request) |
| | `get_content_type` | Get detailed content type information |
| | `create_content_type` | Create new content types |
| | `update_content_type` | Modify existing content types |
| | `publish_content_type` | Publish content type changes |
| | `unpublish_content_type` | Unpublish content types |
| | `delete_content_type` | Remove content types |
| **Entries** | `search_entries` | Search and filter entries in your space |
| | `get_entry` | Retrieve specific entries |
| | `create_entry` | Create new content entries with locale support |
| | `update_entry` | Modify existing entries with locale support |
| | `publish_entry` | Publish entries (single or bulk up to 100) |
| | `unpublish_entry` | Unpublish entries (single or bulk up to 100) |
| | `delete_entry` | Remove entries |
| **Assets** | `upload_asset` | Upload new assets |
| | `list_assets` | List and browse assets (max 3 per request) |
| | `get_asset` | Retrieve specific assets |
| | `update_asset` | Modify asset metadata |
| | `publish_asset` | Publish assets (single or bulk up to 100) |
| | `unpublish_asset` | Unpublish assets (single or bulk up to 100) |
| | `delete_asset` | Remove assets |
| **Spaces & Environments** | `list_spaces` | List available spaces (max 10 per request) |
| | `get_space` | Get space details |
| | `list_environments` | List environments in a space |
| | `create_environment` | Create new environments |
| | `delete_environment` | Remove environments |
| **Locales** | `list_locales` | List all locales in your environment |
| | `get_locale` | Retrieve specific locale information |
| | `create_locale` | Create new locales for multi-language content |
| | `update_locale` | Modify existing locale settings |
| | `delete_locale` | Remove locales from environment |
| **Tags** | `list_tags` | List all tags in an environment |
| | `create_tag` | Create new tags with public/private visibility |
| **Organizations** | `list_orgs` | List organizations user has access to |
| | `get_org` | Get details of a specific organization |
| **AI Actions** | `create_ai_action` | Create custom AI-powered workflows |
| | `invoke_ai_action` | Invoke AI action with variables (bulk support) |
| | `get_ai_action_invocation` | Get AI action invocation details |
| | `get_ai_action` | Retrieve AI action details and configuration |
| | `list_ai_actions` | List AI actions in a space (max 3 per request) |
| | `update_ai_action` | Update existing AI actions |
| | `publish_ai_action` | Publish AI actions for use |
| | `unpublish_ai_action` | Unpublish AI actions |
| | `delete_ai_action` | Remove AI actions |
| **Taxonomy Concepts** | `create_concept` | Create new taxonomy concepts with localization |
| | `get_concept` | Retrieve specific taxonomy concept |
| | `list_concepts` | List concepts with filtering and hierarchy |
| | `update_concept` | Update taxonomy concept properties |
| | `delete_concept` | Remove taxonomy concepts |
| **Taxonomy Schemes** | `create_concept_scheme` | Create new taxonomy concept schemes |
| | `get_concept_scheme` | Retrieve specific concept scheme |
| | `list_concept_schemes` | List concept schemes with pagination |
| | `update_concept_scheme` | Update concept scheme properties |
| | `delete_concept_scheme` | Remove concept schemes |
| **Space Migration** | `space_to_space_migration_handler` | Enable/disable space migration workflow |
| | `space_to_space_param_collection` | Collect parameters for migration workflow |
| | `export_space` | Export space to file for migration |
| | `import_space` | Import space from exported file |

## 🤝 Contributing

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import {
testConceptScheme,
mockConceptSchemeCreate,
mockConceptSchemeCreateWithId,
mockCreateClient,
} from './mockClient.js';
import { createConceptSchemeTool } from './createConceptScheme.js';
import { createToolClient } from '../../../utils/tools.js';
import { formatResponse } from '../../../utils/formatters.js';
import { getDefaultClientConfig } from '../../../config/contentful.js';

describe('createConceptScheme', () => {
beforeEach(() => {
Expand All @@ -26,9 +27,10 @@ describe('createConceptScheme', () => {

const result = await createConceptSchemeTool(testArgs);

expect(createToolClient).toHaveBeenCalledWith({
spaceId: 'dummy',
environmentId: 'dummy',
const clientConfig = getDefaultClientConfig();
delete clientConfig.space;
expect(mockCreateClient).toHaveBeenCalledWith(clientConfig, {
type: 'plain',
});
expect(mockConceptSchemeCreate).toHaveBeenCalledWith(
{
Expand Down
12 changes: 7 additions & 5 deletions src/tools/taxonomies/concept-schemes/createConceptScheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
createSuccessResponse,
withErrorHandling,
} from '../../../utils/response.js';
import { createToolClient } from '../../../utils/tools.js';
import ctfl from 'contentful-management';
import { getDefaultClientConfig } from '../../../config/contentful.js';
import {
ConceptSchemePayload,
TaxonomyConceptLinkSchema,
Expand Down Expand Up @@ -58,10 +59,11 @@ export const CreateConceptSchemeToolParams = z.object({
type Params = z.infer<typeof CreateConceptSchemeToolParams>;

async function tool(args: Params) {
const contentfulClient = createToolClient({
spaceId: 'dummy', // Not needed for concept scheme creation but required by BaseToolSchema
environmentId: 'dummy', // Not needed for concept scheme creation but required by BaseToolSchema
});
// Create a client without space-specific configuration for concept scheme operations
const clientConfig = getDefaultClientConfig();
// Remove space from config since we're working at the organization level
delete clientConfig.space;
const contentfulClient = ctfl.createClient(clientConfig, { type: 'plain' });

// Build the concept scheme payload by filtering out undefined values
const conceptSchemePayload: ConceptSchemePayload = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { mockConceptSchemeDelete } from './mockClient.js';
import { mockConceptSchemeDelete, mockCreateClient } from './mockClient.js';
import { deleteConceptSchemeTool } from './deleteConceptScheme.js';
import { createToolClient } from '../../../utils/tools.js';
import { formatResponse } from '../../../utils/formatters.js';
import { getDefaultClientConfig } from '../../../config/contentful.js';

describe('deleteConceptScheme', () => {
beforeEach(() => {
Expand All @@ -20,9 +20,10 @@ describe('deleteConceptScheme', () => {

const result = await deleteConceptSchemeTool(testArgs);

expect(createToolClient).toHaveBeenCalledWith({
spaceId: 'dummy',
environmentId: 'dummy',
const clientConfig = getDefaultClientConfig();
delete clientConfig.space;
expect(mockCreateClient).toHaveBeenCalledWith(clientConfig, {
type: 'plain',
});

expect(mockConceptSchemeDelete).toHaveBeenCalledWith({
Expand Down
12 changes: 7 additions & 5 deletions src/tools/taxonomies/concept-schemes/deleteConceptScheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
createSuccessResponse,
withErrorHandling,
} from '../../../utils/response.js';
import { createToolClient } from '../../../utils/tools.js';
import ctfl from 'contentful-management';
import { getDefaultClientConfig } from '../../../config/contentful.js';

export const DeleteConceptSchemeToolParams = z.object({
organizationId: z.string().describe('The ID of the Contentful organization'),
Expand All @@ -16,10 +17,11 @@ export const DeleteConceptSchemeToolParams = z.object({
type Params = z.infer<typeof DeleteConceptSchemeToolParams>;

async function tool(args: Params) {
const contentfulClient = createToolClient({
spaceId: 'dummy', // Not needed for concept scheme deletion but required by BaseToolSchema
environmentId: 'dummy', // Not needed for concept scheme deletion but required by BaseToolSchema
});
// Create a client without space-specific configuration for concept scheme operations
const clientConfig = getDefaultClientConfig();
// Remove space from config since we're working at the organization level
delete clientConfig.space;
const contentfulClient = ctfl.createClient(clientConfig, { type: 'plain' });

// Delete the concept scheme
await contentfulClient.conceptScheme.delete({
Expand Down
15 changes: 10 additions & 5 deletions src/tools/taxonomies/concept-schemes/getConceptScheme.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { testConceptScheme, mockConceptSchemeGet } from './mockClient.js';
import {
testConceptScheme,
mockConceptSchemeGet,
mockCreateClient,
} from './mockClient.js';
import { getConceptSchemeTool } from './getConceptScheme.js';
import { createToolClient } from '../../../utils/tools.js';
import { formatResponse } from '../../../utils/formatters.js';
import { getDefaultClientConfig } from '../../../config/contentful.js';

describe('getConceptScheme', () => {
beforeEach(() => {
Expand All @@ -19,9 +23,10 @@ describe('getConceptScheme', () => {

const result = await getConceptSchemeTool(testArgs);

expect(createToolClient).toHaveBeenCalledWith({
spaceId: 'dummy',
environmentId: 'dummy',
const clientConfig = getDefaultClientConfig();
delete clientConfig.space;
expect(mockCreateClient).toHaveBeenCalledWith(clientConfig, {
type: 'plain',
});

expect(mockConceptSchemeGet).toHaveBeenCalledWith({
Expand Down
12 changes: 7 additions & 5 deletions src/tools/taxonomies/concept-schemes/getConceptScheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
createSuccessResponse,
withErrorHandling,
} from '../../../utils/response.js';
import { createToolClient } from '../../../utils/tools.js';
import ctfl from 'contentful-management';
import { getDefaultClientConfig } from '../../../config/contentful.js';

export const GetConceptSchemeToolParams = z.object({
organizationId: z.string().describe('The ID of the Contentful organization'),
Expand All @@ -15,10 +16,11 @@ export const GetConceptSchemeToolParams = z.object({
type Params = z.infer<typeof GetConceptSchemeToolParams>;

async function tool(args: Params) {
const contentfulClient = createToolClient({
spaceId: 'dummy', // Not needed for concept scheme operations but required by BaseToolSchema
environmentId: 'dummy', // Not needed for concept scheme operations but required by BaseToolSchema
});
// Create a client without space-specific configuration for concept scheme operations
const clientConfig = getDefaultClientConfig();
// Remove space from config since we're working at the organization level
delete clientConfig.space;
const contentfulClient = ctfl.createClient(clientConfig, { type: 'plain' });

const params = {
organizationId: args.organizationId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import {
testConceptScheme1,
testConceptScheme2,
mockConceptSchemeGetMany,
mockCreateClient,
} from './mockClient.js';
import { listConceptSchemesTool } from './listConceptSchemes.js';
import { createToolClient } from '../../../utils/tools.js';
import { getDefaultClientConfig } from '../../../config/contentful.js';

const mockConceptSchemesResponse = {
sys: {
Expand All @@ -31,9 +32,10 @@ describe('listConceptSchemes', () => {

const result = await listConceptSchemesTool(testArgs);

expect(createToolClient).toHaveBeenCalledWith({
spaceId: 'dummy',
environmentId: 'dummy',
const clientConfig = getDefaultClientConfig();
delete clientConfig.space;
expect(mockCreateClient).toHaveBeenCalledWith(clientConfig, {
type: 'plain',
});

expect(mockConceptSchemeGetMany).toHaveBeenCalledWith({
Expand Down
Loading