Skip to main content
Glama

get_template_details

Retrieve detailed information about a specific template's structure, content, and configuration in an Anytype space to examine properties before creating new objects.

Instructions

Retrieves detailed information about a specific template in an Anytype space. This tool provides comprehensive details about the template's structure, content, and configuration. Use this tool when you need to examine a template's properties before using it to create new objects, or to understand how a particular template is structured.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesSpace ID containing the template
type_idYesType ID for the template
template_idYesTemplate ID to retrieve details for

Implementation Reference

  • The asynchronous handler function that executes the core logic of the 'get_template_details' tool. It constructs the Anytype API endpoint using the provided space_id, type_id, and template_id, performs a GET request via makeRequest, and returns the JSON-formatted response data or propagates errors through handleApiError.
    async ({ space_id, type_id, template_id }) => { try { const response = await this.makeRequest( "get", `/spaces/${space_id}/types/${type_id}/templates/${template_id}` ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } }
  • Zod schema defining the input parameters for the 'get_template_details' tool, validating space_id, type_id, and template_id as required strings with descriptive metadata.
    { space_id: z.string().describe("Space ID containing the template"), type_id: z.string().describe("Type ID for the template"), template_id: z.string().describe("Template ID to retrieve details for"), },
  • src/index.ts:481-506 (registration)
    The complete registration of the 'get_template_details' tool on the MCP server using McpServer.tool(), specifying the tool name, description, input schema, and handler function.
    "get_template_details", "Retrieves detailed information about a specific template in an Anytype space. This tool provides comprehensive details about the template's structure, content, and configuration. Use this tool when you need to examine a template's properties before using it to create new objects, or to understand how a particular template is structured.", { space_id: z.string().describe("Space ID containing the template"), type_id: z.string().describe("Type ID for the template"), template_id: z.string().describe("Template ID to retrieve details for"), }, async ({ space_id, type_id, template_id }) => { try { const response = await this.makeRequest( "get", `/spaces/${space_id}/types/${type_id}/templates/${template_id}` ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } } );

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

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