anytype_get_object
Retrieve a specific object from Anytype by providing its space and object IDs, enabling access to stored content and data.
Instructions
Obtiene un objeto específico por su ID
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"space_id": "<space_id>",
"object_id": "<object_id>"
},
"name": "anytype_get_object"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | ID del espacio | |
| object_id | Yes | ID del objeto |
Implementation Reference
- src/handlers/objects.ts:116-120 (handler)The core handler function that executes the tool logic: extracts space_id and object_id from arguments, makes an API GET request to retrieve the object, and returns the response as formatted text content.
export async function handleGetObject(args: any) { const { space_id, object_id } = args; const response = await makeRequest(`/v1/spaces/${space_id}/objects/${object_id}`); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; } - src/tools/objects.ts:33-44 (schema)The tool definition including name, description, and inputSchema for validation (requires space_id and object_id). Part of the objectTools array.
{ name: 'anytype_get_object', description: 'Obtiene un objeto específico por su ID', inputSchema: { type: 'object', properties: { space_id: { type: 'string', description: 'ID del espacio' }, object_id: { type: 'string', description: 'ID del objeto' }, }, required: ['space_id', 'object_id'], }, }, - src/index.ts:126-127 (registration)Registration in the main CallToolRequestHandler switch statement: dispatches tool calls matching 'anytype_get_object' to the handleGetObject function.
case 'anytype_get_object': return await handleGetObject(args); - src/index.ts:85-93 (registration)Combines all tool schemas into the tools array (via spread of objectTools which includes anytype_get_object schema) for ListToolsRequestHandler response.
const tools = [ ...spaceTools, ...objectTools, ...propertyTools, ...typeTools, ...tagTools, ...templateTools, ...listTools, ]; - src/handlers/objects.ts:118-119 (helper)Uses the shared makeRequest utility from utils.ts to perform the HTTP request (imported at line 1). Note: full makeRequest implementation is in src/utils.ts.
const response = await makeRequest(`/v1/spaces/${space_id}/objects/${object_id}`); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] };