Skip to main content
Glama

get-content-types

Retrieve content type definitions from Contentful CMS to understand available content structures and fields for managing content.

Instructions

get content types

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:36-76 (registration)
    Registration of the 'get-content-types' tool, including its inline handler. The handler fetches content types from the Contentful API using the provided space ID, environment, and access token, maps to id and name, and returns as formatted JSON text or error message.
    server.tool("get-content-types", "get content types", {}, async () => {
      const restEndpoint = `https://cdn.contentful.com/spaces/${CONTENTFUL_SPACE_ID}/environments/${CONTENTFUL_ENVIRONMENT}/content_types`;
      try {
        const response = await fetch(restEndpoint, {
          headers: {
            Authorization: `Bearer ${CONTENTFUL_ACCESS_TOKEN}`,
          },
        });
    
        if (!response.ok) {
          throw new Error(`http error! status ${response.status}`);
        }
        const data = await response.json();
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                data.items.map((item: any) => ({
                  id: item.sys.id,
                  name: item.name,
                })),
                null,
                2
              ),
            },
          ],
        };
      } catch (error: any) {
        console.error("Error fetching content types:", error);
        return {
          content: [
            {
              type: "text",
              text: `Error: ${error.message}`,
            },
          ],
        };
      }
    });
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 but offers minimal information. 'Get content types' implies a read operation, but doesn't specify whether this requires authentication, what format the results will be in, whether there are rate limits, or any other behavioral characteristics. The description provides only the most basic functional information.

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

Conciseness3/5

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

The description is extremely concise at just three words, but this brevity comes at the cost of being under-specified. While there's no wasted language, the description fails to provide sufficient context about what the tool does beyond the most basic level. It's appropriately sized for what it contains, but what it contains is inadequate.

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 that there are no annotations, no output schema, and a sibling tool exists, the description is incomplete. For a tool that presumably returns content types, the description doesn't explain what format the results will be in, how they're structured, or how this differs from the 'get-entries' sibling tool. The minimal description leaves too many contextual questions unanswered.

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

Parameters4/5

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

The tool has zero parameters with 100% schema description coverage, so the baseline score is 4. The description doesn't need to explain parameters since none exist, and the schema fully documents this. No additional parameter information is required or expected in the description for this parameterless tool.

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

Purpose2/5

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

The description 'get content types' is a tautology that essentially restates the tool name without adding meaningful context. It specifies the verb 'get' and resource 'content types', but lacks any distinction from sibling tools or clarification about what 'content types' refers to in this context. This minimal description provides only basic purpose information.

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. With a sibling tool 'get-entries' available, there's no indication of how these tools differ or when one should be preferred over the other. The description offers no context about appropriate use cases or prerequisites for this operation.

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/tejedamiguel6/MCP-server-Contenful'

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