Skip to main content
Glama

get_entry

Retrieve a specific entry by its content type and entry UID, with options for locale and including references, to efficiently manage and access content.

Instructions

Retrieves a specific entry by its content type UID and entry UID, with options for locale and including references.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
content_type_uidYesContent type UID
entry_uidYesEntry UID to retrieve
include_reference_content_type_uidNoInclude content type UIDs in references
include_referencesNoReferences to include
localeNoLocale code (e.g., 'en-us')

Implementation Reference

  • The main handler function for the 'get_entry' tool. It constructs the Contentstack API URL with provided parameters (content_type_uid, entry_uid, locale, references), makes a GET request using axios, and returns the entry data or handles errors.
    async ({ content_type_uid, entry_uid, locale, include_references, include_reference_content_type_uid }) => {
      try {
        const url = new URL(`${API_BASE_URL}/content_types/${content_type_uid}/entries/${entry_uid}`)
    
        // Add query parameters if provided
        if (locale) {
          url.searchParams.append('locale', locale)
        }
    
        if (include_references && include_references.length > 0) {
          url.searchParams.append('include[]', include_references.join(','))
        }
    
        if (include_reference_content_type_uid) {
          url.searchParams.append('include_reference_content_type_uid', 'true')
        }
    
        const response = await axios.get<EntryResponse>(url.toString(), {
          headers: getHeaders(),
        })
    
        return {
          content: [
            {
              type: 'text',
              text: `Entry retrieved successfully:\n\n${JSON.stringify(response.data.entry, null, 2)}`,
            },
          ],
        }
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error retrieving entry: ${handleError(error as ApiError)}`,
            },
          ],
          isError: true,
        }
      }
  • Zod schema defining the input parameters for the 'get_entry' tool, including required content_type_uid and entry_uid, and optional locale, include_references, and include_reference_content_type_uid.
    {
      content_type_uid: z.string().describe('Content type UID'),
      entry_uid: z.string().describe('Entry UID to retrieve'),
      locale: z.string().optional().describe("Locale code (e.g., 'en-us')"),
      include_references: z.array(z.string()).optional().describe('References to include'),
      include_reference_content_type_uid: z
        .boolean()
        .optional()
        .default(false)
        .describe('Include content type UIDs in references'),
    },
  • src/index.ts:850-905 (registration)
    The server.tool registration call that defines and registers the 'get_entry' tool with the MCP server, including name, description, input schema, and handler function.
    server.tool(
      'get_entry',
      'Retrieves a specific entry by its content type UID and entry UID, with options for locale and including references.',
      {
        content_type_uid: z.string().describe('Content type UID'),
        entry_uid: z.string().describe('Entry UID to retrieve'),
        locale: z.string().optional().describe("Locale code (e.g., 'en-us')"),
        include_references: z.array(z.string()).optional().describe('References to include'),
        include_reference_content_type_uid: z
          .boolean()
          .optional()
          .default(false)
          .describe('Include content type UIDs in references'),
      },
      async ({ content_type_uid, entry_uid, locale, include_references, include_reference_content_type_uid }) => {
        try {
          const url = new URL(`${API_BASE_URL}/content_types/${content_type_uid}/entries/${entry_uid}`)
    
          // Add query parameters if provided
          if (locale) {
            url.searchParams.append('locale', locale)
          }
    
          if (include_references && include_references.length > 0) {
            url.searchParams.append('include[]', include_references.join(','))
          }
    
          if (include_reference_content_type_uid) {
            url.searchParams.append('include_reference_content_type_uid', 'true')
          }
    
          const response = await axios.get<EntryResponse>(url.toString(), {
            headers: getHeaders(),
          })
    
          return {
            content: [
              {
                type: 'text',
                text: `Entry retrieved successfully:\n\n${JSON.stringify(response.data.entry, null, 2)}`,
              },
            ],
          }
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error retrieving entry: ${handleError(error as ApiError)}`,
              },
            ],
            isError: true,
          }
        }
      },
    )
Behavior3/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. It mentions the tool retrieves data (implied read-only) and includes options for locale and references, but lacks details on error handling, permissions, rate limits, or response format. It adds some context but doesn't fully compensate for the missing 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, well-structured sentence that front-loads the core purpose and efficiently lists key options. Every word earns its place with no redundancy or unnecessary elaboration, making it highly concise and easy to parse.

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

Completeness3/5

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

Given 5 parameters, no annotations, and no output schema, the description is adequate but incomplete. It covers the basic purpose and hints at parameter usage, but lacks details on behavioral traits, error cases, or return values, which are important for a retrieval tool with multiple options.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value by mentioning 'options for locale and including references,' which loosely maps to parameters but doesn't provide additional syntax or usage details beyond what the schema provides.

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

Purpose5/5

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

The description clearly states the specific action ('Retrieves'), the resource ('a specific entry'), and the key identifiers ('by its content type UID and entry UID'). It distinguishes from sibling tools like 'get_entries' (plural retrieval) and 'get_content_type' (different resource type), making the purpose unambiguous.

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

Usage Guidelines3/5

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

The description implies usage when you need a single entry with optional locale and reference handling, but it doesn't explicitly state when to use this versus alternatives like 'get_entries' for multiple entries or other retrieval tools. No exclusions or prerequisites are mentioned, leaving some ambiguity.

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

Related 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/darekrossman/contentstack-mcp'

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