Skip to main content
Glama
SpringMT

microCMS MCP Server

by SpringMT

GetMicroCMSContent

Retrieve specific content from microCMS by providing the endpoint and content ID. Use this tool to fetch structured data with optional field selection and reference expansion.

Instructions

Get specific content from MicroCMS by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYesAPI endpoint (e.g., 'blogs')
contentIdYesContent ID to retrieve
fieldsNoComma-separated list of fields to return
depthNoDepth for expanding references

Implementation Reference

  • The asynchronous handler function that fetches specific content from MicroCMS by ID using the client.get method. It constructs queries for optional fields and depth, stringifies the response as formatted JSON, and returns it as text content. Includes error handling to return an error message if the request fails.
        async ({ endpoint, contentId, fields, depth }) => {
            try {
                const queries: Record<string, any> = {};
                
                if (fields) queries.fields = fields;
                if (depth) queries.depth = depth;
                
                const response = await client.get({
                    endpoint,
                    contentId,
                    queries,
                });
                
                // 結果をJSON文字列に変換
                const resultJson = JSON.stringify(response, null, 2);
                
                return {
                    content: [
                        { 
                            type: "text", 
                            text: resultJson
                        }
                    ]
                };
            } catch (error: unknown) {
                console.error("Error getting MicroCMS content:", error);
                const errorMessage = error instanceof Error ? error.message : String(error);
                return {
                    content: [
                        { 
                            type: "text", 
                            text: `Failed to get MicroCMS content: ${errorMessage}`
                        }
                    ]
                };
            }
        }
    );
  • Zod input schema defining required parameters 'endpoint' and 'contentId', with optional 'fields' and 'depth' for customizing the content retrieval.
    {
        endpoint: z.string().describe("API endpoint (e.g., 'blogs')"),
        contentId: z.string().describe("Content ID to retrieve"),
        fields: z.string().optional().describe("Comma-separated list of fields to return"),
        depth: z.number().optional().describe("Depth for expanding references"),
    },
  • src/index.ts:93-139 (registration)
    The server.tool registration call that defines the 'GetMicroCMSContent' tool, including its name, description, input schema, and handler function.
    server.tool(
        "GetMicroCMSContent",
        "Get specific content from MicroCMS by ID",
        {
            endpoint: z.string().describe("API endpoint (e.g., 'blogs')"),
            contentId: z.string().describe("Content ID to retrieve"),
            fields: z.string().optional().describe("Comma-separated list of fields to return"),
            depth: z.number().optional().describe("Depth for expanding references"),
        },
        async ({ endpoint, contentId, fields, depth }) => {
            try {
                const queries: Record<string, any> = {};
                
                if (fields) queries.fields = fields;
                if (depth) queries.depth = depth;
                
                const response = await client.get({
                    endpoint,
                    contentId,
                    queries,
                });
                
                // 結果をJSON文字列に変換
                const resultJson = JSON.stringify(response, null, 2);
                
                return {
                    content: [
                        { 
                            type: "text", 
                            text: resultJson
                        }
                    ]
                };
            } catch (error: unknown) {
                console.error("Error getting MicroCMS content:", error);
                const errorMessage = error instanceof Error ? error.message : String(error);
                return {
                    content: [
                        { 
                            type: "text", 
                            text: `Failed to get MicroCMS content: ${errorMessage}`
                        }
                    ]
                };
            }
        }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a read operation ('Get'), which implies non-destructive behavior, but doesn't mention authentication requirements, rate limits, error handling, or what happens if the content ID doesn't exist. For a tool with no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly. Every word earns its place in conveying the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool with 4 parameters. It doesn't explain what the tool returns (e.g., content object, error responses) or provide behavioral context needed for safe invocation. For a read operation with no structured safety hints, more detail would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter-specific information beyond what's already in the schema, which has 100% coverage with clear descriptions for all 4 parameters. The baseline score of 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate with additional context like examples or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('specific content from MicroCMS by ID'), making the purpose understandable. It distinguishes from the sibling tool 'SearchMicroCMS' by focusing on retrieval by ID rather than search operations. However, it could be more specific about what type of content is retrieved (e.g., blog posts, articles).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'SearchMicroCMS'. It doesn't mention prerequisites, such as needing to know the content ID beforehand, or when not to use it (e.g., for listing content). This leaves the agent without clear usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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