Skip to main content
Glama

anytype_create_property

Add custom properties to objects in Anytype by defining key, name, type, and format to organize and structure data within your workspace.

Instructions

Crea una nueva propiedad

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesID del espacio
keyNoClave única de la propiedad
nameYesNombre de la propiedad
typeYesTipo de propiedad
descriptionNoDescripción
formatNoFormato específico
source_objectNoID del objeto fuente
read_only_valueNoSolo lectura

Implementation Reference

  • The handler function that implements the tool logic: validates inputs (space_id, name, type), constructs the request body, and makes a POST request to the Anytype API to create the property.
    export async function handleCreateProperty(args: any) { const { space_id, name, type, format, description, source_object, read_only_value = false, key, ...propertyData } = args; if (!space_id) { return { content: [{ type: 'text', text: JSON.stringify({ error: 'Missing required parameter', message: 'Field "space_id" is required for creating a property', provided_parameters: Object.keys(args) }, null, 2) }] }; } // Validate required fields based on official API docs if (!name || !type) { return { content: [{ type: 'text', text: JSON.stringify({ error: 'Missing required fields', message: 'Both "name" and "type" are required for creating a property', required_fields: ['name', 'type'], provided_fields: Object.keys(args) }, null, 2) }] }; } const requestBody = { name, type, format: format || type, // Format defaults to type if not provided description, source_object, read_only_value, key, // Optional unique key ...propertyData }; const response = await makeRequest(`/v1/spaces/${space_id}/properties`, { method: 'POST', body: JSON.stringify(requestBody), }); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; }
  • Defines the input schema and metadata for the 'anytype_create_property' tool, specifying parameters, descriptions, and required fields.
    { name: 'anytype_create_property', description: 'Crea una nueva propiedad', inputSchema: { type: 'object', properties: { space_id: { type: 'string', description: 'ID del espacio' }, key: { type: 'string', description: 'Clave única de la propiedad' }, name: { type: 'string', description: 'Nombre de la propiedad' }, type: { type: 'string', description: 'Tipo de propiedad' }, description: { type: 'string', description: 'Descripción' }, format: { type: 'string', description: 'Formato específico' }, source_object: { type: 'string', description: 'ID del objeto fuente' }, read_only_value: { type: 'boolean', description: 'Solo lectura' }, }, required: ['space_id', 'name', 'type'], }, },
  • src/index.ts:140-141 (registration)
    Registers the tool in the main request handler switch statement, dispatching calls to the handleCreateProperty function.
    case 'anytype_create_property': return await handleCreateProperty(args);
  • src/index.ts:88-88 (registration)
    Includes the propertyTools array (containing the tool definition) in the combined list of all available tools for the MCP server.
    ...propertyTools,

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