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.

55 lines (54 loc) 1.49 kB
import { z } from 'zod'; import { TableService } from '../../../../ports/index.js'; import { BaseTool } from './tool.js'; import { RandomTableDTO } from '../../../../domain/index.js'; /** * Input type for the get table tool. */ type GetTableInput = { tableId: string; }; /** * Output type for the get table tool. */ type GetTableOutput = { table: RandomTableDTO; }; /** * Tool for getting a specific table. */ export declare class GetTableTool extends BaseTool<GetTableInput, GetTableOutput> { private readonly tableService; /** * Creates a new GetTableTool 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<GetTableInput>; /** * Gets the output schema for the tool. * @returns The output schema. */ protected getOutputSchema(): z.ZodType<GetTableOutput>; /** * Implements the tool execution logic. * @param args The validated tool arguments. * @returns The tool result. */ protected executeImpl(args: GetTableInput): Promise<GetTableOutput>; } export {};