Skip to main content
Glama

anytype_get_template

Retrieve a specific template from Anytype using space, type, and template IDs to access predefined object structures.

Instructions

Gets a specific template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesSpace ID
type_idYesType ID (required - templates are associated with types)
template_idYesTemplate ID

Implementation Reference

  • Implements the core logic for retrieving a specific template via Anytype API, including input validation for space_id, type_id, template_id and error handling.
    export async function handleGetTemplate(args: any) {
      const { space_id, type_id, template_id } = args;
      
      // type_id is required according to official API docs
      if (!type_id) {
        return { 
          content: [{ 
            type: 'text', 
            text: JSON.stringify({
              error: 'Missing required parameter',
              message: 'Field "type_id" is required for getting a template',
              provided_parameters: Object.keys(args),
              note: 'Templates are associated with specific types in Anytype API 2025-05-20'
            }, null, 2) 
          }] 
        };
      }
      
      try {
        const response = await makeRequest(`/v1/spaces/${space_id}/types/${type_id}/templates/${template_id}`);
        return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] };
      } catch (error: any) {
        return { 
          content: [{ 
            type: 'text', 
            text: JSON.stringify({
              error: 'Template retrieval error',
              message: 'Failed to get template using official API endpoint',
              endpoint: `/v1/spaces/${space_id}/types/${type_id}/templates/${template_id}`,
              error_details: error?.message || String(error),
              suggestions: [
                'Verify that the type_id exists in this space',
                'Verify that the template_id exists for this type',
                'Check API permissions for template access',
                'Ensure space_id, type_id, and template_id are all correct'
              ]
            }, null, 2) 
          }] 
        };
      }
    }
  • Defines the tool schema, description, and input validation schema for 'anytype_get_template'.
    {
      name: 'anytype_get_template',
      description: 'Gets a specific template',
      inputSchema: {
        type: 'object',
        properties: {
          space_id: { type: 'string', description: 'Space ID' },
          type_id: { type: 'string', description: 'Type ID (required - templates are associated with types)' },
          template_id: { type: 'string', description: 'Template ID' },
        },
        required: ['space_id', 'type_id', 'template_id'],
      },
    },
  • src/index.ts:174-175 (registration)
    Registers the tool name in the main switch dispatcher, mapping it to the handleGetTemplate handler.
    case 'anytype_get_template':
      return await handleGetTemplate(args);
  • src/index.ts:85-93 (registration)
    Combines all tool definitions including templateTools (which contains anytype_get_template) into the main tools list served via ListTools.
    const tools = [
      ...spaceTools,
      ...objectTools,
      ...propertyTools,
      ...typeTools,
      ...tagTools,
      ...templateTools,
      ...listTools,
    ];
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. It states 'Gets,' implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns structured data, or handles errors. This is a significant gap 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 extremely concise with a single sentence, 'Gets a specific template,' which is front-loaded and wastes no words. It efficiently conveys the core purpose without unnecessary elaboration, earning full marks for brevity and clarity.

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 (3 required parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what a 'template' is in this context, how the output might be structured, or any behavioral aspects like error handling. This leaves the agent under-informed for proper tool 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?

The input schema has 100% description coverage, clearly documenting all three required parameters (space_id, type_id, template_id). The description adds no additional semantic context beyond the schema, such as explaining relationships between parameters. Baseline 3 is appropriate when the schema does the heavy lifting.

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 'Gets a specific template' clearly states the action (get) and resource (template), which is better than a tautology. However, it lacks specificity about what 'specific' means (e.g., by ID) and doesn't differentiate from sibling tools like 'anytype_list_templates' or 'anytype_get_object', leaving room for ambiguity.

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. For example, it doesn't clarify if this is for retrieving a single template by ID versus listing all templates, nor does it mention prerequisites like needing space and type IDs. This leaves the agent without context for tool selection.

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/cryptonahue/mcp-anytype'

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