set_node_name
Rename nodes in Tana workspaces by specifying the node ID and new name to update data organization.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | ||
| newName | Yes |
Implementation Reference
- src/server/tana-mcp-server.ts:393-424 (registration)Registration of the 'set_node_name' MCP tool, including input schema (nodeId and newName as strings) and the handler function that calls tanaClient.setNodeName and returns formatted result or error.this.server.tool( 'set_node_name', { nodeId: z.string(), newName: z.string() }, async ({ nodeId, newName }) => { try { const result = await this.tanaClient.setNodeName(nodeId, newName); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ], isError: false }; } catch (error) { return { content: [ { type: 'text', text: `Error setting node name: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );
- src/server/tana-client.ts:66-81 (handler)Core handler function in TanaClient that executes the API request to set the node name via POST to Tana API, handling response parsing.async setNodeName(targetNodeId: string, newName: string): Promise<TanaNodeResponse> { const request: TanaSetNameRequest = { targetNodeId, setName: newName }; const response = await this.makeRequest(request); // Handle the different response format for setName if (response.children && response.children.length > 0) { return response.children[0]; } // If the response doesn't match expected format, make a best guess return { nodeId: targetNodeId }; }
- Zod schema for 'set_node_name' tool inputs: nodeId and newName as strings.nodeId: z.string(), newName: z.string() },