create_plain_node
Adds a new plain node to a Tana workspace with specified name, description, and supertags, enabling structured data creation through the Tana Input API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targetNodeId | No | ||
| name | Yes | ||
| description | No | ||
| supertags | No |
Implementation Reference
- src/server/tana-mcp-server.ts:99-129 (handler)The main handler function for the 'create_plain_node' tool. It constructs a TanaPlainNode from inputs and delegates to TanaClient.createNode, returning the result or error in MCP format.async ({ targetNodeId, name, description, supertags }) => { try { const node: TanaPlainNode = { name, description, supertags }; const result = await this.tanaClient.createNode(targetNodeId, node); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ], isError: false }; } catch (error) { return { content: [ { type: 'text', text: `Error creating plain node: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
- src/server/tana-mcp-server.ts:93-98 (schema)Zod schema defining the input parameters for the create_plain_node tool.{ targetNodeId: z.string().optional(), name: z.string(), description: z.string().optional(), supertags: z.array(SupertagSchema).optional() },
- src/server/tana-mcp-server.ts:91-130 (registration)Registration of the 'create_plain_node' tool using McpServer.tool() method.this.server.tool( 'create_plain_node', { targetNodeId: z.string().optional(), name: z.string(), description: z.string().optional(), supertags: z.array(SupertagSchema).optional() }, async ({ targetNodeId, name, description, supertags }) => { try { const node: TanaPlainNode = { name, description, supertags }; const result = await this.tanaClient.createNode(targetNodeId, node); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ], isError: false }; } catch (error) { return { content: [ { type: 'text', text: `Error creating plain node: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );
- src/types/tana-api.ts:21-23 (schema)TypeScript interface defining the structure of a plain node used in the handler.export interface TanaPlainNode extends TanaBaseNode { dataType?: 'plain'; }
- src/server/tana-client.ts:52-58 (helper)Helper method in TanaClient that performs the actual API call to create a single node.async createNode(targetNodeId: string | undefined, node: TanaNode): Promise<TanaNodeResponse> { const nodes = await this.createNodes(targetNodeId, [node]); if (nodes.length === 0) { throw new Error('Failed to create node'); } return nodes[0]; }