Skip to main content
Glama

anytype_create_type

Create custom object types in Anytype by defining unique keys, names, properties, and layouts for structured data organization.

Instructions

Crea un nuevo tipo de objeto

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesID del espacio
keyNoClave única del tipo
nameYesNombre del tipo
plural_nameNoNombre plural del tipo (se auto-genera si no se proporciona)
descriptionNoDescripción del tipo
iconNoIcono
layoutNoLayout del tipo (default: basic)
propertiesNoIDs de propiedades

Implementation Reference

  • The core handler function that implements the 'anytype_create_type' tool. It validates inputs, auto-generates missing fields like plural_name and key, constructs the request body, and makes a POST request to the Anytype API endpoint /v1/spaces/{space_id}/types.
    export async function handleCreateType(args: any) {
      const { space_id, name, plural_name, description, icon, key, layout, properties, ...typeData } = args;
      
      // Validate required fields based on API testing and best practices
      if (!name) {
        return { 
          content: [{ 
            type: 'text', 
            text: JSON.stringify({
              error: 'Missing required field',
              message: 'Field "name" is required for creating a type',
              required_fields: ['name', 'plural_name'],
              provided_fields: Object.keys(args)
            }, null, 2) 
          }] 
        };
      }
      
      // Auto-generate plural_name if not provided
      const finalPluralName = plural_name || (name.endsWith('s') ? name : name + 's');
      
      // Build request body according to API specification with required plural_name and key
      const requestBody = {
        name,
        plural_name: finalPluralName, // Required field (not documented but mandatory)
        description,
        icon,
        key: key || `${name.toLowerCase().replace(/\s+/g, '_')}_${Date.now()}`, // Generate unique key if not provided
        layout: layout || 'basic', // Default to basic layout (required field)
        properties: properties || [], // Array of property IDs
        ...typeData
      };
      
      const response = await makeRequest(`/v1/spaces/${space_id}/types`, {
        method: 'POST',
        body: JSON.stringify(requestBody),
      });
      return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] };
    }
  • The input schema definition for the 'anytype_create_type' tool, defining parameters like space_id, name, key, plural_name, etc., and marking required fields.
    {
      name: 'anytype_create_type',
      description: 'Crea un nuevo tipo de objeto',
      inputSchema: {
        type: 'object',
        properties: {
          space_id: { type: 'string', description: 'ID del espacio' },
          key: { type: 'string', description: 'Clave única del tipo' },
          name: { type: 'string', description: 'Nombre del tipo' },
          plural_name: { type: 'string', description: 'Nombre plural del tipo (se auto-genera si no se proporciona)' },
          description: { type: 'string', description: 'Descripción del tipo' },
          icon: iconSchema,
          layout: { type: 'string', description: 'Layout del tipo (default: basic)' },
          properties: { type: 'array', items: { type: 'string' }, description: 'IDs de propiedades' },
        },
        required: ['space_id', 'name'],
      },
  • src/index.ts:152-153 (registration)
    Registration of the tool handler in the main switch dispatcher for CallToolRequest in the MCP server.
    case 'anytype_create_type':
      return await handleCreateType(args);
  • src/index.ts:54-67 (registration)
    Import statement registering the handleCreateType handler function from types-tags module.
    import {
      handleListTypes,
      handleGetType,
      handleCreateType,
      handleUpdateType,
      handleDeleteType,
      handleListTags,
      handleGetTag,
      handleCreateTag,
      handleUpdateTag,
      handleDeleteTag,
      handleListTemplates,
      handleGetTemplate
    } from './handlers/types-tags.js';
  • src/index.ts:85-93 (registration)
    Inclusion of typeTools (containing the tool schema) in the combined tools list registered with the MCP server for ListToolsRequest.
    const tools = [
      ...spaceTools,
      ...objectTools,
      ...propertyTools,
      ...typeTools,
      ...tagTools,
      ...templateTools,
      ...listTools,
    ];
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states this is a creation operation, implying mutation, but doesn't disclose behavioral traits like permissions needed, whether the creation is reversible, rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 ('Crea un nuevo tipo de objeto') that directly states the purpose without unnecessary words. It's appropriately sized and front-loaded, with zero waste.

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?

Given this is a mutation tool (create) with 8 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address key contextual aspects like what the tool returns, error conditions, or how it integrates with the broader system (e.g., relation to sibling tools). The high parameter count and mutation nature demand more guidance than provided.

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 additional meaning about parameters beyond what's in the schema (e.g., it doesn't explain relationships between parameters like 'key' and 'name', or provide examples). Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Crea un nuevo tipo de objeto' clearly states the action (create) and resource (object type), which is adequate. However, it doesn't differentiate this from sibling tools like 'anytype_create_object' or 'anytype_create_property', leaving ambiguity about what specifically distinguishes an 'object type' from other creatable entities in the system.

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 'create' siblings (object, property, space, tag, type), there's no indication of the specific context or prerequisites for creating an object type, such as whether it requires an existing space or how it relates to other entities.

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