mcp-quickbase
Version:
Work with Quickbase via Model Context Protocol
123 lines (122 loc) • 2.98 kB
TypeScript
import { BaseTool } from "../base";
import { QuickbaseClient } from "../../client/quickbase";
/**
* Field property definitions for various field types
*/
export interface FieldProperties {
maxLength?: number;
defaultValue?: string | number;
precision?: number;
format?: string;
choices?: {
label: string;
value: string;
}[];
targetTableId?: string;
targetFieldId?: string;
appearsByDefault?: boolean;
findEnabled?: boolean;
[key: string]: any;
}
/**
* Parameters for create_field tool
*/
export interface CreateFieldParams {
/**
* ID of the table to create the field in
*/
table_id: string;
/**
* Display label for the field
*/
field_name: string;
/**
* Type of the field: text, text-multi-line, rich-text, numeric, currency,
* percent, rating, date, datetime, checkbox, user, email, url, phone, address, file
*/
field_type: string;
/**
* Help text shown to users when editing the field (stored as fieldHelp)
*/
description?: string;
/**
* Additional options and properties for the field
*/
options?: FieldProperties;
}
/**
* Response from creating a field
*/
export interface CreateFieldResult {
/**
* The ID of the created field
*/
fieldId: string;
/**
* The label/name of the created field
*/
label: string;
/**
* The type of the created field
*/
fieldType: string;
/**
* Help text for the field (shown to users when editing)
*/
fieldHelp?: string;
/**
* The ID of the table the field was created in
*/
tableId: string;
/**
* Additional details about the created field
*/
[key: string]: any;
}
/**
* Tool for creating a new field in a Quickbase table
*/
export declare class CreateFieldTool extends BaseTool<CreateFieldParams, CreateFieldResult> {
name: string;
description: string;
/**
* Parameter schema for create_field
*/
paramSchema: {
type: string;
properties: {
table_id: {
type: string;
description: string;
};
field_name: {
type: string;
description: string;
};
field_type: {
type: string;
description: string;
};
description: {
type: string;
description: string;
};
options: {
type: string;
description: string;
};
};
required: string[];
};
/**
* Constructor
* @param client Quickbase client
*/
constructor(client: QuickbaseClient);
/**
* Run the create_field tool
* @param params Tool parameters
* @returns Created field details
*/
protected run(params: CreateFieldParams): Promise<CreateFieldResult>;
}