playground_command_help
Get detailed help for Kafka Docker Playground CLI commands to understand usage, parameters, and troubleshooting steps.
Instructions
Get detailed help for playground commands
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Command to get help for (e.g., 'connector restart', 'container logs') |
Implementation Reference
- src/index.ts:153-166 (handler)The handler function for the 'playground_command_help' MCP tool. Extracts the 'command' argument, delegates to parser.getCommandHelp(), and returns the result formatted as MCP text content.private async handleCommandHelp(args: any) { const { command } = args; const help = this.parser.getCommandHelp(command); return { content: [ { type: "text", text: JSON.stringify(help, null, 2), }, ], }; }
- src/index.ts:76-85 (schema)Input schema for the 'playground_command_help' tool, defining a required 'command' string parameter with description.inputSchema: { type: "object", properties: { command: { type: "string", description: "Command to get help for (e.g., 'connector restart', 'container logs')", }, }, required: ["command"], },
- src/index.ts:102-103 (registration)Switch case in CallToolRequest handler that registers and routes calls to the 'playground_command_help' tool handler.case "playground_command_help": return await this.handleCommandHelp(args);
- src/parser.ts:265-294 (helper)Primary helper implementing the help logic: splits command string, finds matching command via findCommand, assembles detailed help object with options, subcommands, examples, and generated usage.public getCommandHelp(commandString: string): any { const parts = commandString.trim().split(' ').filter(p => p.length > 0); // Remove 'playground' if it's the first part if (parts[0] === 'playground') { parts.shift(); } const command = this.findCommand(parts); if (command) { return { command: parts.join(' '), description: command.description, options: command.options || [], subcommands: command.subcommands?.map(sub => ({ name: sub.name, description: sub.description, options: sub.options || [] })) || [], examples: command.examples || [], usage: this.generateUsage(command, parts.join(' ')) }; } return { error: 'Command not found', command: commandString }; }
- src/parser.ts:194-205 (helper)Supporting helper to locate a command or subcommand by path array, used by getCommandHelp.public findCommand(commandPath: string[]): PlaygroundCommand | null { let current = this.commands; let command: PlaygroundCommand | null = null; for (const part of commandPath) { command = current.find(cmd => cmd.name === part) || null; if (!command) return null; current = command.subcommands || []; } return command; }