anytype_get_property
Retrieve a specific property from Anytype objects by providing the space ID and property ID, enabling access to object data through the Anytype API.
Instructions
Obtiene una propiedad específica
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | ID del espacio | |
| property_id | Yes | ID de la propiedad |
Implementation Reference
- src/handlers/properties.ts:31-49 (handler)The handler function `handleGetProperty` that implements the core logic for the 'anytype_get_property' tool. It validates the required parameters (space_id and property_id), makes a GET request to the Anytype API endpoint `/v1/spaces/{space_id}/properties/{property_id}`, and returns the response as formatted text.export async function handleGetProperty(args: any) { const { space_id, property_id } = args; if (!space_id || !property_id) { return { content: [{ type: 'text', text: JSON.stringify({ error: 'Missing required parameters', message: 'Fields "space_id" and "property_id" are required for getting a property', provided_parameters: Object.keys(args) }, null, 2) }] }; } const response = await makeRequest(`/v1/spaces/${space_id}/properties/${property_id}`); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; }
- src/tools/properties.ts:20-31 (schema)The schema definition for the 'anytype_get_property' tool, including input schema with required fields space_id and property_id.{ name: 'anytype_get_property', description: 'Obtiene una propiedad específica', inputSchema: { type: 'object', properties: { space_id: { type: 'string', description: 'ID del espacio' }, property_id: { type: 'string', description: 'ID de la propiedad' }, }, required: ['space_id', 'property_id'], }, },
- src/index.ts:138-139 (registration)Registration of the tool in the main MCP server request handler switch statement, which routes calls to the handleGetProperty function.case 'anytype_get_property': return await handleGetProperty(args);
- src/index.ts:88-88 (registration)Inclusion of propertyTools (containing the schema) into the combined tools list served by the MCP server....propertyTools,
- src/index.ts:46-52 (registration)Import of the handleGetProperty handler function from the properties handler module.import { handleListProperties, handleGetProperty, handleCreateProperty, handleUpdateProperty, handleDeleteProperty } from './handlers/properties.js';