anytype_update_property
Modify an existing property in Anytype by updating its name, description, format, source object, or read-only status within a specified space.
Instructions
Actualiza una propiedad existente
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | ID del espacio | |
| property_id | Yes | ID de la propiedad | |
| name | No | Nuevo nombre | |
| description | No | Nueva descripción | |
| format | No | Nuevo formato | |
| source_object | No | Nuevo objeto fuente | |
| read_only_value | No | Solo lectura |
Implementation Reference
- src/handlers/properties.ts:108-140 (handler)The handler function that destructures arguments, validates required fields, builds the PATCH request body with provided updates, and calls the Anytype API to update the property.export async function handleUpdateProperty(args: any) { const { space_id, property_id, name, description, format, source_object, read_only_value, ...updateData } = 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 updating a property', provided_parameters: Object.keys(args) }, null, 2) }] }; } // Build update payload with only provided fields const requestBody: any = {}; if (name !== undefined) requestBody.name = name; if (description !== undefined) requestBody.description = description; if (format !== undefined) requestBody.format = format; if (source_object !== undefined) requestBody.source_object = source_object; if (read_only_value !== undefined) requestBody.read_only_value = read_only_value; // Add any additional update data Object.assign(requestBody, updateData); const response = await makeRequest(`/v1/spaces/${space_id}/properties/${property_id}`, { method: 'PATCH', body: JSON.stringify(requestBody), }); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; }
- src/tools/properties.ts:50-66 (schema)The input schema definition for the tool, specifying parameters and required fields.{ name: 'anytype_update_property', description: 'Actualiza una propiedad existente', inputSchema: { type: 'object', properties: { space_id: { type: 'string', description: 'ID del espacio' }, property_id: { type: 'string', description: 'ID de la propiedad' }, name: { type: 'string', description: 'Nuevo nombre' }, description: { type: 'string', description: 'Nueva descripción' }, format: { type: 'string', description: 'Nuevo formato' }, source_object: { type: 'string', description: 'Nuevo objeto fuente' }, read_only_value: { type: 'boolean', description: 'Solo lectura' }, }, required: ['space_id', 'property_id'], }, },
- src/index.ts:142-143 (registration)The switch case in the CallToolRequest handler that routes calls to this tool to the handleUpdateProperty function.case 'anytype_update_property': return await handleUpdateProperty(args);
- src/index.ts:85-93 (registration)Inclusion of propertyTools (containing this tool's schema) in the list of tools returned by ListToolsRequest.const tools = [ ...spaceTools, ...objectTools, ...propertyTools, ...typeTools, ...tagTools, ...templateTools, ...listTools, ];
- src/index.ts:46-52 (registration)Import of the handleUpdateProperty handler function used in the tool dispatch.import { handleListProperties, handleGetProperty, handleCreateProperty, handleUpdateProperty, handleDeleteProperty } from './handlers/properties.js';