anytype_update_type
Modify an existing type in Anytype by updating its name, description, icon, layout, or properties to adapt your workspace structure.
Instructions
Actualiza un tipo existente
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"space_id": "<space_id>",
"type_id": "<type_id>"
},
"name": "anytype_update_type"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | ID del espacio | |
| type_id | Yes | ID del tipo | |
| name | No | Nuevo nombre | |
| description | No | Nueva descripción | |
| icon | No | Icono | |
| layout | No | Nuevo layout | |
| properties | No | Nuevos IDs de propiedades |
Implementation Reference
- src/handlers/types-tags.ts:69-76 (handler)The main handler function for 'anytype_update_type' tool. It destructures args to get space_id, type_id, and updateData, then makes a PATCH request to the Anytype API endpoint `/v1/spaces/${space_id}/types/${type_id}` and returns the response as formatted text.
export async function handleUpdateType(args: any) { const { space_id, type_id, ...updateData } = args; const response = await makeRequest(`/v1/spaces/${space_id}/types/${type_id}`, { method: 'PATCH', body: JSON.stringify(updateData), }); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; } - src/tools/types.ts:49-65 (schema)The tool schema definition including name, description, and inputSchema for validating arguments to the 'anytype_update_type' tool.
{ name: 'anytype_update_type', description: 'Actualiza un tipo existente', inputSchema: { type: 'object', properties: { space_id: { type: 'string', description: 'ID del espacio' }, type_id: { type: 'string', description: 'ID del tipo' }, name: { type: 'string', description: 'Nuevo nombre' }, description: { type: 'string', description: 'Nueva descripción' }, icon: iconSchema, layout: { type: 'string', description: 'Nuevo layout' }, properties: { type: 'array', items: { type: 'string' }, description: 'Nuevos IDs de propiedades' }, }, required: ['space_id', 'type_id'], }, }, - src/index.ts:154-155 (registration)The switch case in the CallToolRequestHandler that registers and dispatches calls to the handleUpdateType handler for the 'anytype_update_type' tool.
case 'anytype_update_type': return await handleUpdateType(args); - src/index.ts:85-93 (registration)The tools array construction that includes typeTools (containing the schema for anytype_update_type) for the ListToolsRequestHandler.
const tools = [ ...spaceTools, ...objectTools, ...propertyTools, ...typeTools, ...tagTools, ...templateTools, ...listTools, ]; - src/index.ts:58-58 (registration)Import of the handleUpdateType function from handlers/types-tags.js, necessary for registration in the switch dispatcher.
handleUpdateType,