create_url_node
Add web links to Tana workspaces by creating URL nodes with descriptions and tags for organized reference.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targetNodeId | No | ||
| url | Yes | ||
| description | No | ||
| supertags | No |
Implementation Reference
- src/server/tana-mcp-server.ts:223-255 (handler)The core handler function for the 'create_url_node' tool. It constructs a TanaUrlNode object from the input parameters and delegates the creation to the TanaClient's createNode method, returning the result or error in MCP format.async ({ targetNodeId, url, description, supertags }) => { try { const node: TanaUrlNode = { dataType: 'url', name: url, 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 URL node: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );
- Zod input schema for the create_url_node tool, validating optional targetNodeId, required valid URL, optional description, and optional array of supertags.{ targetNodeId: z.string().optional(), url: z.string().url(), description: z.string().optional(), supertags: z.array(SupertagSchema).optional() },
- src/server/tana-mcp-server.ts:216-255 (registration)The registration of the 'create_url_node' tool on the MCP server within the registerTools method, including the tool name, input schema, and inline handler function.'create_url_node', { targetNodeId: z.string().optional(), url: z.string().url(), description: z.string().optional(), supertags: z.array(SupertagSchema).optional() }, async ({ targetNodeId, url, description, supertags }) => { try { const node: TanaUrlNode = { dataType: 'url', name: url, 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 URL node: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );
- src/types/tana-api.ts:35-38 (schema)TypeScript interface definition for TanaUrlNode, which defines the structure used when creating URL nodes in the handler.export interface TanaUrlNode extends TanaBaseNode { dataType: 'url'; name: string; // URL string }
- src/server/tana-mcp-server.ts:21-24 (schema)Zod schema for supertags, used in the input schema for supertags array in create_url_node.const SupertagSchema = z.object({ id: z.string(), fields: z.record(z.string()).optional() });