Skip to main content
Glama

get_types

Retrieve all available object types from an Anytype space to understand what objects can be created and find correct type IDs for new object creation.

Instructions

Retrieves all object types available in a specified Anytype space. This tool provides information about the different types of objects that can be created in the space, including their IDs, names, and metadata. Results are paginated for spaces with many types. Use this tool when you need to understand what types of objects can be created or to find the correct type ID for creating new objects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesSpace ID to get types from
offsetNoPagination offset
limitNoNumber of results per page (1-100)

Implementation Reference

  • The async handler function that validates parameters, makes a GET request to `/spaces/${space_id}/types` via makeRequest, formats the response as text content, and handles errors.
    async ({ space_id, offset, limit }) => { try { // Validate limit const validLimit = Math.max(1, Math.min(1000, limit)); const response = await this.makeRequest( "get", `/spaces/${space_id}/types`, null, { offset, limit: validLimit } ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } }
  • Zod input schema for the get_types tool, defining required space_id and optional pagination parameters offset and limit.
    { space_id: z.string().describe("Space ID to get types from"), offset: z.number().optional().default(0).describe("Pagination offset"), limit: z .number() .optional() .default(100) .describe("Number of results per page (1-100)"), },
  • src/index.ts:374-410 (registration)
    Full registration of the 'get_types' tool with McpServer.tool(), including name, description, input schema, and inline handler function.
    // Tool 9: Get types in a space this.server.tool( "get_types", "Retrieves all object types available in a specified Anytype space. This tool provides information about the different types of objects that can be created in the space, including their IDs, names, and metadata. Results are paginated for spaces with many types. Use this tool when you need to understand what types of objects can be created or to find the correct type ID for creating new objects.", { space_id: z.string().describe("Space ID to get types from"), offset: z.number().optional().default(0).describe("Pagination offset"), limit: z .number() .optional() .default(100) .describe("Number of results per page (1-100)"), }, async ({ space_id, offset, limit }) => { try { // Validate limit const validLimit = Math.max(1, Math.min(1000, limit)); const response = await this.makeRequest( "get", `/spaces/${space_id}/types`, null, { offset, limit: validLimit } ); 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