get_type_details
Retrieve comprehensive structural details about an object type in Anytype, including its relations, views, and configuration options.
Instructions
Retrieves detailed information about a specific object type in an Anytype space. This tool provides comprehensive details about the type's structure, including its relations, views, and configuration options. Use this tool when you need to understand the structure of a particular object type or to examine its available relations and properties.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | Space ID containing the type | |
| type_id | Yes | Type ID to retrieve details for |
Implementation Reference
- src/index.ts:413-438 (registration)Registration of the 'get_type_details' tool with MCP server, including input schema (space_id and type_id) and handler function that makes a GET request to the Anytype API endpoint `/spaces/{space_id}/types/{type_id}` and returns the formatted JSON response.this.server.tool( "get_type_details", "Retrieves detailed information about a specific object type in an Anytype space. This tool provides comprehensive details about the type's structure, including its relations, views, and configuration options. Use this tool when you need to understand the structure of a particular object type or to examine its available relations and properties.", { space_id: z.string().describe("Space ID containing the type"), type_id: z.string().describe("Type ID to retrieve details for"), }, async ({ space_id, type_id }) => { try { const response = await this.makeRequest( "get", `/spaces/${space_id}/types/${type_id}` ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } } );
- src/index.ts:420-437 (handler)The handler function executes the core logic: authenticates and calls the Anytype API to retrieve detailed type information, formats the response as text content, and handles errors using the class's error handler.async ({ space_id, type_id }) => { try { const response = await this.makeRequest( "get", `/spaces/${space_id}/types/${type_id}` ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } }
- src/index.ts:416-419 (schema)Zod schema defining the input parameters: space_id (string) and type_id (string).{ space_id: z.string().describe("Space ID containing the type"), type_id: z.string().describe("Type ID to retrieve details for"), },