create_reference_node
Create a reference node in Tana workspaces by linking to existing nodes using target and reference IDs, enabling structured data connections.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targetNodeId | No | ||
| referenceId | Yes |
Implementation Reference
- src/server/tana-mcp-server.ts:139-167 (handler)The main handler function for the 'create_reference_node' tool. It constructs a TanaReferenceNode with the provided referenceId and creates it under the optional targetNodeId using the tanaClient.async ({ targetNodeId, referenceId }) => { try { const node: TanaReferenceNode = { dataType: 'reference', id: referenceId }; 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 reference node: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; }
- Zod schema defining the input parameters: optional targetNodeId (string) and required referenceId (string).{ targetNodeId: z.string().optional(), referenceId: z.string()
- src/server/tana-mcp-server.ts:133-169 (registration)Registration of the 'create_reference_node' tool using this.server.tool(), including schema and inline handler.this.server.tool( 'create_reference_node', { targetNodeId: z.string().optional(), referenceId: z.string() }, async ({ targetNodeId, referenceId }) => { try { const node: TanaReferenceNode = { dataType: 'reference', id: referenceId }; 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 reference node: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );