UNPKG

mcp-quickbase

Version:

Work with Quickbase via Model Context Protocol

127 lines (126 loc) 2.98 kB
import { BaseTool } from "../base"; import { QuickbaseClient } from "../../client/quickbase"; /** * Field information in a relationship */ export interface RelationshipFieldInfo { /** * The ID of the field */ id: number; /** * The label (display name) of the field */ label: string; /** * The type of the field */ type: string; } /** * Relationship between two tables */ export interface Relationship { /** * The ID of the relationship (same as the foreign key field ID) */ id: number; /** * The ID of the parent table */ parentTableId: string; /** * The ID of the child table */ childTableId: string; /** * The foreign key field in the child table */ foreignKeyField: RelationshipFieldInfo; /** * Whether this is a cross-app relationship */ isCrossApp: boolean; /** * Lookup fields in the child table that pull data from the parent */ lookupFields: RelationshipFieldInfo[]; /** * Summary fields in the parent table that aggregate data from the child */ summaryFields: RelationshipFieldInfo[]; } /** * Parameters for get_relationships tool */ export interface GetRelationshipsParams { /** * The ID of the table to get relationships for */ table_id: string; /** * Number of relationships to skip (for pagination) */ skip?: number; } /** * Response from getting relationships */ export interface GetRelationshipsResult { /** * Array of relationships */ relationships: Relationship[]; /** * Metadata about the response */ metadata: { /** * Total number of relationships for the table */ totalRelationships: number; /** * Number of relationships returned in this response */ numRelationships: number; /** * Number of relationships skipped */ skip: number; }; } /** * Tool for retrieving all table-to-table relationships for a specified table */ export declare class GetRelationshipsTool extends BaseTool<GetRelationshipsParams, GetRelationshipsResult> { name: string; description: string; /** * Parameter schema for get_relationships */ paramSchema: { type: string; properties: { table_id: { type: string; description: string; }; skip: { type: string; description: string; }; }; required: string[]; }; /** * Constructor * @param client Quickbase client */ constructor(client: QuickbaseClient); /** * Run the get_relationships tool * @param params Tool parameters * @returns Relationships for the table */ protected run(params: GetRelationshipsParams): Promise<GetRelationshipsResult>; }