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.

63 lines (62 loc) 1.63 kB
import { z } from 'zod'; import { TableService } from '../../../../ports/index.js'; import { BaseTool } from './tool.js'; /** * Input type for the create table tool. */ type CreateTableInput = { name: string; description?: string; entries?: Array<{ content: string; weight?: number; range?: { min: number; max: number; }; }>; }; /** * Output type for the create table tool. */ type CreateTableOutput = { tableId: string; }; /** * Tool for creating tables. */ export declare class CreateTableTool extends BaseTool<CreateTableInput, CreateTableOutput> { private readonly tableService; /** * Creates a new CreateTableTool 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<CreateTableInput>; /** * Gets the output schema for the tool. * @returns The output schema. */ protected getOutputSchema(): z.ZodType<CreateTableOutput>; /** * Implements the tool execution logic. * @param args The validated tool arguments. * @returns The tool result. */ protected executeImpl(args: CreateTableInput): Promise<CreateTableOutput>; } export {};