UNPKG

@bilims/mcp-sqlserver

Version:

MCP Server for Microsoft SQL Server with CRUD operations and data analysis capabilities

84 lines (83 loc) 2.4 kB
import { z } from 'zod'; import { DatabaseConnection } from '../database/connection.js'; export declare const GetTablesSchema: z.ZodObject<{ schema: z.ZodOptional<z.ZodString>; pattern: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { schema?: string | undefined; pattern?: string | undefined; }, { schema?: string | undefined; pattern?: string | undefined; }>; export declare const GetColumnsSchema: z.ZodObject<{ table: z.ZodString; schema: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { table: string; schema?: string | undefined; }, { table: string; schema?: string | undefined; }>; export declare const GetIndexesSchema: z.ZodObject<{ table: z.ZodString; schema: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { table: string; schema?: string | undefined; }, { table: string; schema?: string | undefined; }>; export declare const GetForeignKeysSchema: z.ZodObject<{ table: z.ZodString; schema: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { table: string; schema?: string | undefined; }, { table: string; schema?: string | undefined; }>; export declare class SchemaTools { private db; constructor(db: DatabaseConnection); getTables(params?: z.infer<typeof GetTablesSchema>): Promise<{ success: boolean; tables: import("mssql").IRecordSet<any>; count: number; }>; getColumns(params: z.infer<typeof GetColumnsSchema>): Promise<{ success: boolean; table: string; columns: any[]; count: number; }>; getIndexes(params: z.infer<typeof GetIndexesSchema>): Promise<{ success: boolean; table: string; indexes: any[]; count: number; }>; getForeignKeys(params: z.infer<typeof GetForeignKeysSchema>): Promise<{ success: boolean; table: string; foreignKeys: import("mssql").IRecordSet<any>; count: number; }>; getTableStructure(params: z.infer<typeof GetColumnsSchema>): Promise<{ success: boolean; table: string; structure: { columns: any[]; indexes: any[]; foreignKeys: import("mssql").IRecordSet<any>; }; }>; getSchemas(): Promise<{ success: boolean; schemas: import("mssql").IRecordSet<any>; count: number; }>; }