Skip to main content
Glama
microcmsio

microCMS MCP Server

by microcmsio

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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();
    }
  • 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;
  • 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();
    }

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/microcmsio/microcms-mcp-server'

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