Skip to main content
Glama

anytype_create_space

Create a new workspace in Anytype to organize content and collaborate with team members using customizable names, descriptions, and icons.

Instructions

Crea un nuevo espacio

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNombre del espacio
descriptionNoDescripción del espacio
iconNoIcono

Implementation Reference

  • The core handler function that implements the tool logic: validates required 'name' field, constructs API request body, performs POST to /v1/spaces, handles response with enhanced success message.
    export async function handleCreateSpace(args: any) { const { name, description, icon, ...spaceData } = args; // Validate required fields if (!name) { return { content: [{ type: 'text', text: JSON.stringify({ error: 'Missing required field', message: 'Field "name" is required for creating a space', required_fields: ['name'], provided_fields: Object.keys(args) }, null, 2) }] }; } // Build request body according to API specification const requestBody = { name, description: description || '', // Optional but recommended icon: icon || null, // Optional icon ...spaceData }; const response = await makeRequest('/v1/spaces', { method: 'POST', body: JSON.stringify(requestBody), }); // Enhance response with verification if (response && response.space) { const enhancedResponse = { success: true, message: `Space "${name}" created successfully`, space: response.space, space_id: response.space.id, next_steps: [ 'Use the space_id to create objects, types, and properties in this space', 'Switch to this space using anytype_get_space if needed' ] }; return { content: [{ type: 'text', text: JSON.stringify(enhancedResponse, null, 2) }] }; } return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; }
  • Tool definition including name, description, and input schema for validation (requires 'name', optional 'description' and 'icon').
    { name: 'anytype_create_space', description: 'Crea un nuevo espacio', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Nombre del espacio' }, description: { type: 'string', description: 'Descripción del espacio' }, icon: iconSchema, }, required: ['name'], }, },
  • src/index.ts:112-113 (registration)
    Registers the tool name in the main request handler switch statement, dispatching calls to the handleCreateSpace function.
    case 'anytype_create_space': return await handleCreateSpace(args);
  • src/index.ts:96-100 (registration)
    Registers the list of all tools (including anytype_create_space from spaceTools) for the ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { 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