Skip to main content
Glama

anytype_create_object

Create a new object in an Anytype space with customizable properties, markdown content, and icons to organize information.

Instructions

Crea un nuevo objeto en un espacio

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesID del espacio
nameYesNombre del objeto
type_keyNoTipo de objetopage
bodyNoContenido del objeto (Markdown)
markdownNoContenido del objeto (Markdown) - alias para body
iconNoIcono
propertiesNoPropiedades del objeto
template_idNoID de plantilla

Implementation Reference

  • The main handler function that implements the logic for creating a new Anytype object, processing properties including tags, making the API POST request, and formatting the response.
    export async function handleCreateObject(args: any) {
      const { space_id, properties, ...objectData } = args;
      
      // Handle markdown alias
      if (objectData.markdown && !objectData.body) {
        objectData.body = objectData.markdown;
        delete objectData.markdown;
      }
      
      // Process and validate tags if properties are provided
      let processedProperties = [];
      if (properties && Array.isArray(properties)) {
        processedProperties = await validateAndProcessTags(space_id, properties);
        console.log(`Processed ${processedProperties.length} properties for new object`);
      }
      
      const finalObjectData = {
        ...objectData,
        ...(processedProperties.length > 0 && { properties: processedProperties })
      };
      
      const response = await makeRequest(`/v1/spaces/${space_id}/objects`, {
        method: 'POST',
        body: JSON.stringify(finalObjectData),
      });
      
      return { 
        content: [{ 
          type: 'text', 
          text: JSON.stringify({
            message: 'Object created successfully',
            object: response,
            processed_properties: processedProperties.length,
            tag_assignments: processedProperties.filter(p => p.multi_select || p.select).length
          }, null, 2) 
        }] 
      };
    }
  • The tool schema definition including input parameters, descriptions, and validation rules for anytype_create_object.
      name: 'anytype_create_object',
      description: 'Crea un nuevo objeto en un espacio',
      inputSchema: {
        type: 'object',
        properties: {
          space_id: { type: 'string', description: 'ID del espacio' },
          name: { type: 'string', description: 'Nombre del objeto' },
          type_key: { type: 'string', description: 'Tipo de objeto', default: 'page' },
          body: { type: 'string', description: 'Contenido del objeto (Markdown)' },
          markdown: { type: 'string', description: 'Contenido del objeto (Markdown) - alias para body' },
          icon: iconSchema,
          properties: objectPropertiesSchema,
          template_id: { type: 'string', description: 'ID de plantilla' },
        },
        required: ['space_id', 'name'],
      },
    },
  • src/index.ts:128-129 (registration)
    The dispatch case in the main MCP server request handler that routes calls to the anytype_create_object tool to its handler function.
    case 'anytype_create_object':
      return await handleCreateObject(args);
  • Helper function used by the handler to validate and process object properties, particularly handling multi-select and select tags.
    async function validateAndProcessTags(spaceId: string, properties: any[]): Promise<any[]> {
      if (!properties || !Array.isArray(properties)) {
        return [];
      }
    
      const processedProperties = [];
    
      for (const prop of properties) {
        const processedProp = { ...prop };
    
        // Handle multi_select properties (tags)
        if (prop.multi_select && Array.isArray(prop.multi_select)) {
          try {
            // Validate that all tag IDs exist
            // Note: We can't easily validate individual tags without knowing the property_id
            // This is a limitation of the current API structure
            console.log(`Processing multi_select property "${prop.key}" with ${prop.multi_select.length} tags`);
            processedProp.multi_select = prop.multi_select;
          } catch (error) {
            console.warn(`Warning: Could not validate tags for property "${prop.key}":`, error);
            // Keep the tags anyway, let the API handle validation
            processedProp.multi_select = prop.multi_select;
          }
        }
    
        // Handle single select properties
        if (prop.select) {
          try {
            console.log(`Processing select property "${prop.key}" with tag: ${prop.select}`);
            processedProp.select = prop.select;
          } catch (error) {
            console.warn(`Warning: Could not validate tag for property "${prop.key}":`, error);
            processedProp.select = prop.select;
          }
        }
    
        processedProperties.push(processedProp);
      }
    
      return processedProperties;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Crea un nuevo objeto' implies a write/mutation operation, the description doesn't mention required permissions, whether this operation is idempotent, what happens on conflicts, or what the response contains. For a creation tool with complex parameters and no annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Spanish that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with 8 parameters (including complex nested objects), no annotations, and no output schema, the description is inadequate. It doesn't explain what an 'object' represents in this context, what happens after creation, error conditions, or how this differs from similar tools. The single sentence leaves too many contextual gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Crea un nuevo objeto') and target resource ('en un espacio'), which is a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'anytype_update_object' or explain what differentiates creating an object from other creation tools like 'anytype_create_space' or 'anytype_create_tag'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools including 'anytype_update_object', 'anytype_get_object', and various other creation tools, there's no indication of when creation is appropriate versus updating, retrieving, or using other object-related operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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