Skip to main content
Glama
getEditorInterface.ts1.09 kB
import { z } from 'zod'; import { createSuccessResponse, withErrorHandling, } from '../../utils/response.js'; import { BaseToolSchema, createToolClient } from '../../utils/tools.js'; import type { ContentfulConfig } from '../../config/types.js'; export const GetEditorInterfaceToolParams = BaseToolSchema.extend({ contentTypeId: z .string() .describe( 'The ID of the content type to retrieve the editor interface for', ), }); type Params = z.infer<typeof GetEditorInterfaceToolParams>; export function getEditorInterfaceTool(config: ContentfulConfig) { async function tool(args: Params) { const params = { spaceId: args.spaceId, environmentId: args.environmentId, contentTypeId: args.contentTypeId, }; const contentfulClient = createToolClient(config, args); const editorInterface = await contentfulClient.editorInterface.get(params); return createSuccessResponse('Editor interface retrieved successfully', { editorInterface, }); } return withErrorHandling(tool, 'Error retrieving editor interface'); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/contentful/contentful-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server