Skip to main content
Glama

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
NameRequiredDescriptionDefault
space_idYesID del espacio
property_idYesID de la propiedad
nameNoNuevo nombre
descriptionNoNueva descripción
formatNoNuevo formato
source_objectNoNuevo objeto fuente
read_only_valueNoSolo lectura

Implementation Reference

  • 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) }] };
    }
  • 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';

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/cryptonahue/mcp-anytype'

If you have feedback or need assistance with the MCP directory API, please join our Discord server