Skip to main content
Glama
microcmsio

microCMS MCP Server

by microcmsio

microcms_get_list

Retrieve content lists from microCMS with filtering, sorting, pagination, and search capabilities for managing blog posts, news articles, or other content types.

Instructions

Get a list of contents from microCMS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYesContent type name (e.g., "blogs", "news")
draftKeyNoDraft key for preview
limitNoNumber of contents to retrieve (1-100)
offsetNoOffset for pagination
ordersNoSort order (e.g., "-publishedAt" for descending)
qNoFull-text search query
fieldsNoComma-separated list of fields to retrieve
idsNoComma-separated list of content IDs
filtersNoFilter conditions
depthNoDepth of reference expansion (1-3)

Implementation Reference

  • Handler function for the microcms_get_list tool. Parses input parameters into MicroCMS queries and calls the underlying getList client function.
    export async function handleGetList(params: ToolParameters) {
      const { endpoint, ...options } = params;
      
      const queries: MicroCMSListOptions = {};
      
      if (options.draftKey) queries.draftKey = options.draftKey;
      if (options.limit) queries.limit = options.limit;
      if (options.offset) queries.offset = options.offset;
      if (options.orders) queries.orders = options.orders;
      if (options.q) queries.q = options.q;
      if (options.fields) queries.fields = options.fields;
      if (options.ids) queries.ids = options.ids;
      if (options.filters) queries.filters = options.filters;
      if (options.depth) queries.depth = options.depth;
    
      return await getList(endpoint, queries);
    }
  • Tool schema definition including name, description, and detailed inputSchema for parameters like endpoint, limit, filters, etc.
    export const getListTool: Tool = {
      name: 'microcms_get_list',
      description: 'Get a list of contents from microCMS',
      inputSchema: {
        type: 'object',
        properties: {
          endpoint: {
            type: 'string',
            description: 'Content type name (e.g., "blogs", "news")',
          },
          draftKey: {
            type: 'string',
            description: 'Draft key for preview',
          },
          limit: {
            type: 'number',
            description: 'Number of contents to retrieve (1-100)',
            minimum: 1,
            maximum: 100,
          },
          offset: {
            type: 'number',
            description: 'Offset for pagination',
            minimum: 0,
          },
          orders: {
            type: 'string',
            description: 'Sort order (e.g., "-publishedAt" for descending)',
          },
          q: {
            type: 'string',
            description: 'Full-text search query',
          },
          fields: {
            type: 'string',
            description: 'Comma-separated list of fields to retrieve',
          },
          ids: {
            type: 'string',
            description: 'Comma-separated list of content IDs',
          },
          filters: {
            type: 'string',
            description: 'Filter conditions',
          },
          depth: {
            type: 'number',
            description: 'Depth of reference expansion (1-3)',
            minimum: 1,
            maximum: 3,
          },
        },
        required: ['endpoint'],
      },
    };
  • src/server.ts:82-84 (registration)
    Registration of the tool handler in the main switch statement for CallToolRequestSchema.
    case 'microcms_get_list':
      result = await handleGetList(params);
      break;
  • src/server.ts:47-72 (registration)
    Registration of the tool in the ListToolsRequestSchema handler, exposing the schema to clients.
    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,
        ],
      };
    });
  • Core helper function that performs the actual API call to microCMS getList endpoint using the microCMSClient.
    export async function getList<T = MicroCMSContent>(
      endpoint: string,
      queries?: MicroCMSQueries
    ): Promise<MicroCMSListResponse<T>> {
      return await microCMSClient.getList<T>({
        endpoint,
        queries,
      });
    }

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