anytype_delete_property
Remove a property from an Anytype object by specifying the space ID and property ID. This tool deletes custom properties to clean up object structures.
Instructions
Elimina una propiedad
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:146-166 (handler)The main handler function that destructures the input arguments, validates required parameters (space_id and property_id), and sends a DELETE request to the Anytype API endpoint `/v1/spaces/{space_id}/properties/{property_id}` to delete the property. Returns the API response as text content.export async function handleDeleteProperty(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 deleting a property', provided_parameters: Object.keys(args) }, null, 2) }] }; } const response = await makeRequest(`/v1/spaces/${space_id}/properties/${property_id}`, { method: 'DELETE', }); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; }
- src/tools/properties.ts:67-78 (schema)The schema definition for the 'anytype_delete_property' tool within the propertyTools array, defining the input schema with required string parameters space_id and property_id.{ name: 'anytype_delete_property', description: 'Elimina una propiedad', 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:144-145 (registration)The switch case in the CallToolRequest handler that routes calls to 'anytype_delete_property' to the handleDeleteProperty function.case 'anytype_delete_property': return await handleDeleteProperty(args);
- src/index.ts:46-52 (registration)The import statement in src/index.ts that brings in the handleDeleteProperty handler from src/handlers/properties.ts.import { handleListProperties, handleGetProperty, handleCreateProperty, handleUpdateProperty, handleDeleteProperty } from './handlers/properties.js';
- src/index.ts:17-88 (registration)The import of propertyTools (containing the tool schema) and its inclusion in the combined tools list used for ListToolsRequest in the MCP server.import { propertyTools } from './tools/properties.js'; import { typeTools } from './tools/types.js'; import { tagTools } from './tools/tags.js'; import { templateTools } from './tools/templates.js'; import { listTools } from './tools/lists.js'; // Import handlers import { handleListSpaces, handleGetSpace, handleCreateSpace, handleUpdateSpace, handleListMembers, handleGetMember } from './handlers/spaces.js'; import { handleSearchObjects, handleListObjects, handleGetObject, handleCreateObject, handleUpdateObject, handleDeleteObject, handleAddToCollection, handleRemoveFromCollection, handleGetListViews, handleGetListObjects } from './handlers/objects.js'; import { handleListProperties, handleGetProperty, handleCreateProperty, handleUpdateProperty, handleDeleteProperty } from './handlers/properties.js'; import { handleListTypes, handleGetType, handleCreateType, handleUpdateType, handleDeleteType, handleListTags, handleGetTag, handleCreateTag, handleUpdateTag, handleDeleteTag, handleListTemplates, handleGetTemplate } from './handlers/types-tags.js'; console.error('API Key:', process.env.ANYTYPE_API_KEY ? 'Present' : 'Missing'); // Create the server const server = new Server( { name: 'anytype-mcp-server', version: '0.1.0', }, { capabilities: { tools: {}, }, } ); // Combine all tools from modules const tools = [ ...spaceTools, ...objectTools, ...propertyTools,