Skip to main content
Glama

get_content_type

Retrieve a specific content type by its UID using this tool. Optionally include global field schemas for detailed schema analysis.

Instructions

Retrieves a specific content type by its UID, optionally including the global field schema.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_global_field_schemaNoInclude global field schemas
uidYesContent type UID to retrieve

Implementation Reference

  • src/index.ts:698-738 (registration)
    Registration of the 'get_content_type' tool using server.tool(), including description, input schema with Zod validation, and the handler function.
    server.tool(
      'get_content_type',
      'Retrieves a specific content type by its UID, optionally including the global field schema.',
      {
        uid: z.string().describe('Content type UID to retrieve'),
        include_global_field_schema: z.boolean().optional().default(false).describe('Include global field schemas'),
      },
      async ({ uid, include_global_field_schema }) => {
        try {
          const url = new URL(`${API_BASE_URL}/content_types/${uid}`)
    
          // Add query parameter if needed
          if (include_global_field_schema) {
            url.searchParams.append('include_global_field_schema', 'true')
          }
    
          const response = await axios.get<ContentTypeResponse>(url.toString(), {
            headers: getHeaders(),
          })
    
          return {
            content: [
              {
                type: 'text',
                text: `Content type retrieved successfully:\n\n${JSON.stringify(response.data.content_type, null, 2)}`,
              },
            ],
          }
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error retrieving content type: ${handleError(error as ApiError)}`,
              },
            ],
            isError: true,
          }
        }
      },
    )
  • The handler function implements the core logic: constructs the Contentstack API URL for the specific content type UID, optionally appends global field schema query param, fetches data using axios, formats and returns the response or error.
    async ({ uid, include_global_field_schema }) => {
      try {
        const url = new URL(`${API_BASE_URL}/content_types/${uid}`)
    
        // Add query parameter if needed
        if (include_global_field_schema) {
          url.searchParams.append('include_global_field_schema', 'true')
        }
    
        const response = await axios.get<ContentTypeResponse>(url.toString(), {
          headers: getHeaders(),
        })
    
        return {
          content: [
            {
              type: 'text',
              text: `Content type retrieved successfully:\n\n${JSON.stringify(response.data.content_type, null, 2)}`,
            },
          ],
        }
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error retrieving content type: ${handleError(error as ApiError)}`,
            },
          ],
          isError: true,
        }
      }
    },
  • Input schema defined using Zod for validation: requires 'uid' string, optional boolean 'include_global_field_schema' defaulting to false.
    {
      uid: z.string().describe('Content type UID to retrieve'),
      include_global_field_schema: z.boolean().optional().default(false).describe('Include global field schemas'),
    },
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 the tool retrieves data, implying a read-only operation, but doesn't specify if it requires authentication, rate limits, error handling, or what the return format looks like (e.g., JSON structure). For a retrieval tool with zero 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 front-loads the core purpose ('Retrieves a specific content type by its UID') and adds an optional feature ('optionally including the global field schema'). There is no wasted text, and it's appropriately sized for a simple retrieval tool.

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 the tool's low complexity (2 parameters, no nested objects) and high schema coverage, the description is minimally adequate. However, with no output schema and no annotations, it lacks details on return values, error cases, or behavioral traits. For a retrieval tool in a set with many siblings, more context on output format or integration would improve completeness.

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%, with clear descriptions for both parameters in the schema: 'uid' as the content type UID to retrieve and 'include_global_field_schema' as a boolean to include global field schemas. The description adds minimal value beyond the schema by mentioning the optional inclusion of global field schema, but doesn't provide additional context like format examples or usage tips. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb 'retrieves' and the resource 'specific content type by its UID', which is specific and actionable. It distinguishes from siblings like 'get_all_content_types' by specifying retrieval of a single item rather than listing all. However, it doesn't explicitly differentiate from 'get_entry' or other get_* tools beyond the resource name.

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 by mentioning retrieval of a content type by UID, which suggests this tool is for fetching a single known content type. It doesn't provide explicit guidance on when to use this vs. alternatives like 'get_all_content_types' for listing or 'get_entry' for entries, nor does it mention prerequisites or exclusions, leaving usage context somewhat implied.

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