quickbase_get_relationship_details
Retrieve comprehensive details about table relationships and lookup fields for a specified table ID, including optional related field information, using the QuickBase MCP Server.
Instructions
Get detailed information about table relationships including lookup fields
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeFields | No | Include related field details | |
| tableId | Yes | Table ID to analyze relationships for |
Implementation Reference
- src/quickbase/client.ts:385-425 (handler)Core handler function that retrieves detailed relationship information for a specified table, including parent/child relationships and optionally related reference/lookup fields.async getRelationshipDetails(tableId: string, includeFields: boolean = true): Promise<any> { try { const relationships = await this.getRelationships(tableId); const tableInfo = await this.getTableInfo(tableId); const result = { tableId, tableName: tableInfo.name, relationships: [] as any[], relatedFields: [] as any[] }; for (const relationship of relationships) { const relationshipDetail: any = { parentTableId: relationship.parentTableId, childTableId: relationship.childTableId, foreignKeyFieldId: relationship.foreignKeyFieldId, type: 'one-to-many' // QuickBase primarily supports one-to-many }; if (includeFields) { // Get fields related to this relationship const fields = await this.getTableFields(tableId); const relatedFields = fields.filter(field => field.fieldType === 'reference' || field.fieldType === 'lookup' || (field.properties && field.properties.lookupReference) ); relationshipDetail.relatedFields = relatedFields; } result.relationships.push(relationshipDetail); } return result; } catch (error) { console.error('Error getting relationship details:', error); throw error; } }
- src/tools/index.ts:481-492 (registration)Tool registration entry defining the tool name, description, and input schema for MCP integration.{ name: 'quickbase_get_relationship_details', description: 'Get detailed information about table relationships including lookup fields', inputSchema: { type: 'object', properties: { tableId: { type: 'string', description: 'Table ID to analyze relationships for' }, includeFields: { type: 'boolean', default: true, description: 'Include related field details' } }, required: ['tableId'] } },
- src/tools/index.ts:484-492 (schema)JSON schema defining the input parameters for the tool.inputSchema: { type: 'object', properties: { tableId: { type: 'string', description: 'Table ID to analyze relationships for' }, includeFields: { type: 'boolean', default: true, description: 'Include related field details' } }, required: ['tableId'] } },
- src/quickbase/client.ts:250-255 (helper)Helper method to fetch basic relationships for a table, used within getRelationshipDetails.async getRelationships(tableId: string): Promise<any[]> { const response = await this.axios.get(`/relationships`, { params: { childTableId: tableId } }); return response.data; }