create_field
Add custom fields to Tana workspace nodes to organize and enrich data with structured metadata.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targetNodeId | No | SCHEMA | |
| name | Yes | ||
| description | No |
Implementation Reference
- src/server/tana-mcp-server.ts:502-538 (registration)Registration of the 'create_field' MCP tool. Includes inline Zod input schema (targetNodeId optional default 'SCHEMA', name required, description optional) and the handler function that creates a TanaPlainNode with supertag 'SYS_T02' (field definition) under the target node and calls tanaClient.createNode.this.server.tool( 'create_field', { targetNodeId: z.string().optional().default('SCHEMA'), name: z.string(), description: z.string().optional() }, async ({ targetNodeId, name, description }) => { try { const node: TanaPlainNode = { name, description, supertags: [{ id: 'SYS_T02' }] }; 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 field: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
- src/server/tana-mcp-server.ts:509-537 (handler)The handler function for the create_field tool. Constructs a plain node with the given name and description, tagged with supertag 'SYS_T02' for field definitions, creates it under targetNodeId (default 'SCHEMA'), and returns the result or error.async ({ targetNodeId, name, description }) => { try { const node: TanaPlainNode = { name, description, supertags: [{ id: 'SYS_T02' }] }; 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 field: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; }
- Zod input schema for the create_field tool defining parameters: targetNodeId (optional, defaults to 'SCHEMA'), name (required string), description (optional string).targetNodeId: z.string().optional().default('SCHEMA'), name: z.string(), description: z.string().optional()
- Documentation description of the create_field tool in the API docs resource.- \`create_field\`: Create new field definitions