Skip to main content
Glama

contentrain_describe

Retrieve the complete schema for a single content model to understand its structure and fields before creating content.

Instructions

Get full schema of a single model (read-only). Do NOT manually create content files — use contentrain_content_save instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel ID (e.g. "blog-post", "hero")
include_sampleNoInclude one sample entry
localeNoLocale for sample content (default: config default locale)

Implementation Reference

  • The handler function for the 'contentrain_describe' tool. It fetches model definition, stats, and optionally a sample entry, then returns the schema and metadata.
    server.tool(
      'contentrain_describe',
      'Get full schema of a single model (read-only). Do NOT manually create content files — use contentrain_content_save instead.',
      {
        model: z.string().describe('Model ID (e.g. "blog-post", "hero")'),
        include_sample: z.boolean().optional().default(false).describe('Include one sample entry'),
        locale: z.string().optional().describe('Locale for sample content (default: config default locale)'),
      },
      async ({ model: modelId, include_sample, locale }) => {
        const modelDef = await readModel(projectRoot, modelId)
        if (!modelDef) {
          return {
            content: [{ type: 'text' as const, text: JSON.stringify({ error: `Model "${modelId}" not found` }) }],
            isError: true,
          }
        }
    
        const config = await readConfig(projectRoot)
        const effectiveLocale = locale ?? config?.locales.default ?? 'en'
        const stats = await countEntries(projectRoot, modelDef)
    
        const result: Record<string, unknown> = {
          id: modelDef.id,
          name: modelDef.name,
          kind: modelDef.kind,
          domain: modelDef.domain,
          i18n: modelDef.i18n,
          description: modelDef.description,
          fields: modelDef.fields,
          stats: { total_entries: stats.total, locales: stats.locales },
        }
    
        if (include_sample) {
          const sample = await getSample(projectRoot, modelDef, effectiveLocale)
          if (sample) result['sample'] = sample
        }
    
        // Stack-aware import snippet
        const stack = config?.stack ?? 'other'
        result['import_snippet'] = generateImportSnippet(modelDef, stack, effectiveLocale)
    
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
        }
      },
    )
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses read-only nature explicitly and warns against manual file creation workflow. Deduct one point for not describing return format, error conditions, or cache behavior.

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?

Two sentences, zero waste. Front-loaded with primary purpose, second sentence provides critical workflow guidance. Every word earns its place.

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

Completeness4/5

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

Appropriate for a read-only schema inspection tool with simple parameters. Lacks output schema description (what the returned schema object contains), but the read-only warning and alternative tool reference provide sufficient context for safe invocation.

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 has 100% description coverage with examples ('blog-post', 'hero') and defaults documented. Description mentions 'single model' aligning with the model parameter but adds no syntax details beyond schema. Baseline 3 appropriate when schema does heavy lifting.

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?

Clear specific verb ('Get') + resource ('full schema of a single model') with scope limitation. Explicitly distinguishes from content manipulation siblings by mentioning contentrain_content_save as the alternative for creating content.

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

Usage Guidelines5/5

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

Explicit negative constraint ('Do NOT manually create content files') and names the specific alternative tool to use instead ('use contentrain_content_save instead'). Prevents confusion between schema inspection and content creation.

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/Contentrain/ai'

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