UNPKG

random-tables-mcp

Version:

An MCP (Model Context Protocol) server for managing and rolling on random-table assets used in tabletop RPGs. Create, update, and roll on random tables with support for nested tables, weighted entries, and range-based results.

59 lines (58 loc) 1.56 kB
import { z } from 'zod'; import { TableService } from '../../../../ports/index.js'; import { BaseTool } from './tool.js'; /** * Input type for the list tables tool. */ type ListTablesInput = { filter?: Record<string, unknown>; }; /** * Output type for the list tables tool. */ type ListTablesOutput = { tables: { id: string; name: string; description?: string; entryCount: number; }[]; }; /** * Tool for listing tables. */ export declare class ListTablesTool extends BaseTool<ListTablesInput, ListTablesOutput> { private readonly tableService; /** * Creates a new ListTablesTool instance. * @param tableService The table service to use. */ constructor(tableService: TableService); /** * Gets the name of the tool. * @returns The tool name. */ protected getToolName(): string; /** * Gets the description of the tool. * @returns The tool description. */ protected getToolDescription(): string; /** * Gets the input schema for the tool. * @returns The input schema. */ protected getInputSchema(): z.ZodType<ListTablesInput>; /** * Gets the output schema for the tool. * @returns The output schema. */ protected getOutputSchema(): z.ZodType<ListTablesOutput>; /** * Implements the tool execution logic. * @param args The validated tool arguments. * @returns The tool result. */ protected executeImpl(args: ListTablesInput): Promise<ListTablesOutput>; } export {};