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.
80 lines (79 loc) • 2.13 kB
TypeScript
import { z } from 'zod';
import { TableService } from '../../../../ports/index.js';
import { BaseTool } from './tool.js';
/**
* Input type for the update table tool.
*/
type UpdateTableInput = {
tableId: string;
updates: {
name?: string;
description?: string;
entries?: {
add?: Array<{
content: string;
weight?: number;
range?: {
min: number;
max: number;
};
}>;
update?: Array<{
id: string;
updates: {
content?: string;
weight?: number;
range?: {
min: number;
max: number;
};
};
}>;
remove?: string[];
};
};
};
/**
* Output type for the update table tool.
*/
type UpdateTableOutput = {
success: boolean;
};
/**
* Tool for updating tables.
*/
export declare class UpdateTableTool extends BaseTool<UpdateTableInput, UpdateTableOutput> {
private readonly tableService;
/**
* Creates a new UpdateTableTool 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<UpdateTableInput>;
/**
* Gets the output schema for the tool.
* @returns The output schema.
*/
protected getOutputSchema(): z.ZodType<UpdateTableOutput>;
/**
* Implements the tool execution logic.
* @param args The validated tool arguments.
* @returns The tool result.
*/
protected executeImpl(args: UpdateTableInput): Promise<UpdateTableOutput>;
}
export {};