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
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | Space ID containing the template | |
| type_id | Yes | Type ID for the template | |
| template_id | Yes | Template ID to retrieve details for |
Implementation Reference
- src/index.ts:488-505 (handler)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); } }
- src/index.ts:483-487 (schema)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); } } );