microcms_get_api_list
Retrieve all available API endpoints from microCMS Management API, including names, endpoints, and types (list/object) for content management operations.
Instructions
Get list of all available APIs (endpoints) from microCMS Management API. Returns API name, endpoint, and type (list/object) for each API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get-apis-list.ts:15-17 (handler)The main handler function for the 'microcms_get_api_list' tool, which calls the underlying getApiList function from the client module.export async function handleGetApiList(params: ToolParameters) { return await getApiList(); }
- src/tools/get-apis-list.ts:5-13 (schema)Tool definition including name, description, and input schema (empty object, no parameters required). This is used for registration and validation.export const getApiListTool: Tool = { name: 'microcms_get_api_list', description: 'Get list of all available APIs (endpoints) from microCMS Management API. Returns API name, endpoint, and type (list/object) for each API.', inputSchema: { type: 'object', properties: {}, required: [], }, };
- src/server.ts:47-72 (registration)Registration of the tool in the MCP server's listTools handler, where getApiListTool is included in the array of available tools.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ getListTool, getListMetaTool, getContentTool, getContentMetaTool, createContentPublishedTool, createContentDraftTool, createContentsBulkPublishedTool, createContentsBulkDraftTool, updateContentPublishedTool, updateContentDraftTool, patchContentTool, patchContentStatusTool, patchContentCreatedByTool, deleteContentTool, getMediaTool, uploadMediaTool, deleteMediaTool, getApiInfoTool, getApiListTool, getMemberTool, ], }; });
- src/server.ts:136-138 (registration)Dispatch registration in the CallToolRequestSchema handler's switch statement, mapping the tool name to its handler function.case 'microcms_get_api_list': result = await handleGetApiList(params); break;
- src/client.ts:112-128 (helper)Core helper function that performs the actual API call to retrieve the list of APIs from microCMS Management API.export async function getApiList(): Promise<any> { const url = `https://${config.serviceDomain}.microcms-management.io/api/v1/apis`; 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 list: ${response.status} ${response.statusText} - ${errorText}`); } return await response.json(); }