Skip to main content
Glama

get-entries

Retrieve content entries from Contentful CMS by specifying a content type to access structured data for your projects.

Instructions

Get entries for a specific content type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentTypeYes

Implementation Reference

  • The handler function for the 'get-entries' tool. It takes a contentType parameter, constructs the Contentful API endpoint to fetch entries (limited to 10), fetches the data, and returns it as JSON-formatted text or an error message.
    async (parameters) => {
      const { contentType } = parameters;
      const entriesEndpoint = `https://cdn.contentful.com/spaces/${CONTENTFUL_SPACE_ID}/environments/${CONTENTFUL_ENVIRONMENT}/entries?content_type=${contentType}&limit=10`;
    
      try {
        const response = await fetch(entriesEndpoint, {
          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, null, 2),
            },
          ],
        };
      } catch (error: any) {
        console.error("Error fetching entries:", error);
        return {
          content: [
            {
              type: "text",
              text: `Error: ${error.message}`,
            },
          ],
        };
      }
    }
  • Input schema for the 'get-entries' tool, defining 'contentType' as a required string parameter using Zod.
    {
      contentType: z.string(),
    },
  • src/index.ts:78-121 (registration)
    Registration of the 'get-entries' tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool(
      "get-entries",
      "Get entries for a specific content type",
      {
        contentType: z.string(),
      },
      async (parameters) => {
        const { contentType } = parameters;
        const entriesEndpoint = `https://cdn.contentful.com/spaces/${CONTENTFUL_SPACE_ID}/environments/${CONTENTFUL_ENVIRONMENT}/entries?content_type=${contentType}&limit=10`;
    
        try {
          const response = await fetch(entriesEndpoint, {
            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, null, 2),
              },
            ],
          };
        } catch (error: any) {
          console.error("Error fetching entries:", error);
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error.message}`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get entries', implying a read operation, but doesn't disclose any behavioral traits such as permissions needed, rate limits, pagination, or what the return format looks like. This leaves significant gaps for a tool with no annotation coverage.

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 with no wasted words. It is appropriately sized and front-loaded, stating the core purpose directly. Every word earns its place, making it highly concise and well-structured.

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 complexity of a tool with 1 parameter, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'entries' are, how they are returned, or any behavioral aspects. This is inadequate for a tool that likely returns data, as users need more context to use it effectively.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, and the description adds minimal meaning. It mentions 'content type' as the parameter but doesn't explain what content types are available, their format, or examples. This fails to compensate for the low schema coverage, leaving the parameter poorly documented.

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

Purpose3/5

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

The description states the tool's purpose as 'Get entries for a specific content type', which is clear but vague. It specifies the verb 'Get' and resource 'entries', but lacks detail on what 'entries' are or how they relate to 'content type'. It distinguishes from sibling 'get-content-types' by focusing on entries rather than types, but the distinction is minimal.

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?

No guidance is provided on when to use this tool versus alternatives. The description implies usage when entries for a content type are needed, but it doesn't specify prerequisites, exclusions, or context. With a sibling tool 'get-content-types', there's no mention of whether to use one before the other or in what scenarios.

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