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.

60 lines (59 loc) 1.58 kB
import { z } from 'zod'; import { BaseTool } from './tool.js'; import { RollService } from '../../../../ports/index.js'; /** * Input type for the roll on table tool. */ type RollOnTableInput = { tableId: string; count?: number; }; /** * Output type for the roll on table tool. */ type RollOnTableOutput = { results: Array<{ tableId: string; entryId: string; content: string; timestamp: string; }>; }; /** * Tool for rolling on tables. */ export declare class RollOnTableTool extends BaseTool<RollOnTableInput, RollOnTableOutput> { private readonly rollService; /** * Creates a new RollOnTableTool instance. * @param rollService The roll service to use. */ constructor(rollService: RollService); /** * 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<RollOnTableInput>; /** * Gets the output schema for the tool. * @returns The output schema. */ protected getOutputSchema(): z.ZodType<RollOnTableOutput>; /** * Implements the tool execution logic. * @param args The validated tool arguments. * @returns The tool result. */ protected executeImpl(args: RollOnTableInput): Promise<RollOnTableOutput>; } export {};