microcms_get_api_info
Retrieve API schema information from microCMS Management API to understand content structure and field relationships, including referenced endpoints in relation fields.
Instructions
Get API schema information from microCMS Management API. In relation and relationList field, you can get its schema using referencedApiEndpoint and microcms_get_api_info tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | Yes | Content type name to get schema info (e.g., "blogs", "news") |
Implementation Reference
- src/client.ts:94-110 (handler)Core implementation of fetching API schema information from microCMS Management API using the management endpoint.export async function getApiInfo(endpoint: string): Promise<any> { const url = `https://${config.serviceDomain}.microcms-management.io/api/v1/apis/${endpoint}`; const response = await fetch(url, { method: 'GET', headers: { 'X-MICROCMS-API-KEY': config.apiKey, }, }); if (!response.ok) { const errorText = await response.text(); throw new Error(`Failed to get API info: ${response.status} ${response.statusText} - ${errorText}`); } return await response.json(); }
- src/tools/get-api-info.ts:5-18 (schema)Tool definition including input schema for the microcms_get_api_info tool.export const getApiInfoTool: Tool = { name: 'microcms_get_api_info', description: 'Get API schema information from microCMS Management API. In relation and relationList field, you can get its schema using referencedApiEndpoint and microcms_get_api_info tool.', inputSchema: { type: 'object', properties: { endpoint: { type: 'string', description: 'Content type name to get schema info (e.g., "blogs", "news")', }, }, required: ['endpoint'], }, };
- src/tools/get-api-info.ts:20-24 (handler)Tool-specific handler that extracts the endpoint parameter and delegates to the core getApiInfo function.export async function handleGetApiInfo(params: ToolParameters) { const { endpoint } = params; return await getApiInfo(endpoint); }
- src/server.ts:133-135 (registration)Dispatch case in the server tool caller that invokes the tool handler.case 'microcms_get_api_info': result = await handleGetApiInfo(params); break;
- src/server.ts:67-67 (registration)Registration of the tool in the listTools response.getApiInfoTool,