quickbase_create_relationship
Establish parent-child relationships between tables by linking them via a foreign key field using this MCP server tool for QuickBase.
Instructions
Create a parent-child relationship between tables
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| childTableId | Yes | Child table ID | |
| foreignKeyFieldId | Yes | Foreign key field ID in child table | |
| parentTableId | Yes | Parent table ID |
Implementation Reference
- src/quickbase/client.ts:242-248 (handler)Core implementation of quickbase_create_relationship: sends POST request to QuickBase /relationships endpoint with parent/child table IDs and foreign key field ID.async createRelationship(parentTableId: string, childTableId: string, foreignKeyFieldId: number): Promise<void> { await this.axios.post('/relationships', { parentTableId, childTableId, foreignKeyFieldId }); }
- src/index.ts:333-349 (handler)MCP server handler for the tool call: validates args, calls QuickBaseClient.createRelationship, and returns success message.case 'quickbase_create_relationship': if (!args || typeof args !== 'object') { throw new Error('Invalid arguments'); } await this.qbClient.createRelationship( args.parentTableId as string, args.childTableId as string, args.foreignKeyFieldId as number ); return { content: [ { type: 'text', text: `Relationship created between ${args.parentTableId} and ${args.childTableId}`, }, ], };
- src/tools/index.ts:71-75 (schema)Zod input schema definition for validating tool parameters.const CreateRelationshipSchema = z.object({ parentTableId: z.string().describe('Parent table ID'), childTableId: z.string().describe('Child table ID'), foreignKeyFieldId: z.number().describe('Foreign key field ID in child table') });
- src/tools/index.ts:366-378 (registration)Tool registration in quickbaseTools array, including name, description, and input schema for MCP discovery.{ name: 'quickbase_create_relationship', description: 'Create a parent-child relationship between tables', inputSchema: { type: 'object', properties: { parentTableId: { type: 'string', description: 'Parent table ID' }, childTableId: { type: 'string', description: 'Child table ID' }, foreignKeyFieldId: { type: 'number', description: 'Foreign key field ID in child table' } }, required: ['parentTableId', 'childTableId', 'foreignKeyFieldId'] } },