UNPKG

bknd

Version:

Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.

41 lines (40 loc) 1.58 kB
import type { App } from "../.."; import { type Tool, type ToolAnnotation, type Resource, type ToolHandlerCtx, s } from "bknd/utils"; import type { ModuleBuildContext } from "../../modules"; import type { DbModuleManager } from "../../modules/db/DbModuleManager"; export declare const mcpSchemaSymbol: unique symbol; export interface McpToolOptions { title?: string; description?: string; annotations?: ToolAnnotation; tools?: Tool<any, any, any>[]; resources?: Resource<any, any, any, any>[]; } export type SchemaWithMcpOptions<AdditionalOptions = {}> = { mcp?: McpToolOptions & AdditionalOptions; }; export type AppToolContext = { app: App; ctx: () => ModuleBuildContext; }; export type AppToolHandlerCtx = ToolHandlerCtx<AppToolContext>; export interface McpSchema extends s.Schema { getTools(node: s.Node<any>): Tool<any, any, any>[]; } export declare class McpSchemaHelper<AdditionalOptions = {}> { schema: s.Schema; name: string; options: McpToolOptions & AdditionalOptions; cleanSchema: s.ObjectSchema<any, any>; constructor(schema: s.Schema, name: string, options: McpToolOptions & AdditionalOptions); getCleanSchema(schema: s.ObjectSchema): s.ObjectSchema<s.TProperties, s.IObjectOptions> | s.ObjectSchema<any, any>; getToolOptions(suffix?: string): { title: string | undefined; description: string | undefined; annotations: { destructiveHint: boolean; idempotentHint: boolean; }; }; getManager(ctx: AppToolHandlerCtx): DbModuleManager; }