Skip to main content
Glama
vdesabou

MCP Playground Server

by vdesabou

playground_command_suggest

Generate command suggestions and completions for Kafka Docker Playground CLI operations based on partial input and context.

Instructions

Get command suggestions and completions for the Kafka Docker Playground CLI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partial_commandYesPartial playground command to complete
contextNoAdditional context about what you're trying to do

Implementation Reference

  • MCP tool handler function that processes the tool call, invokes the suggester for suggestions, retrieves command structure from parser, and returns formatted JSON response.
    private async handleCommandSuggest(args: any) {
      const { partial_command, context } = args;
      
      const suggestions = await this.suggester.getSuggestions(partial_command, context);
      
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              suggestions,
              command_structure: this.parser.getCommandStructure(partial_command),
            }, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the playground_command_suggest tool, specifying parameters partial_command (required) and optional context.
    inputSchema: {
      type: "object",
      properties: {
        partial_command: {
          type: "string",
          description: "Partial playground command to complete",
        },
        context: {
          type: "string",
          description: "Additional context about what you're trying to do",
        },
      },
      required: ["partial_command"],
    },
  • src/index.ts:41-59 (registration)
    Tool registration in ListTools response, defining name, description, and input schema.
    {
      name: "playground_command_suggest",
      description: "Get command suggestions and completions for the Kafka Docker Playground CLI",
      inputSchema: {
        type: "object",
        properties: {
          partial_command: {
            type: "string",
            description: "Partial playground command to complete",
          },
          context: {
            type: "string",
            description: "Additional context about what you're trying to do",
          },
        },
        required: ["partial_command"],
      },
    },
    {
  • Core helper function implementing the suggestion logic: parses partial command, handles top-level, command, and option suggestions by delegating to specialized methods.
    async getSuggestions(partialCommand: string, context?: string): Promise<CommandSuggestion[]> {
      const suggestions: CommandSuggestion[] = [];
      const parts = partialCommand.trim().split(' ').filter(p => p.length > 0);
      
      // Remove 'playground' if it's the first part
      if (parts.length > 0 && parts[0] === 'playground') {
        parts.shift();
      }
    
      if (parts.length === 0) {
        // Suggest top-level commands
        const commands = this.parser.getCommands();
        commands.forEach(cmd => {
          suggestions.push({
            completion: `playground ${cmd.name}`,
            description: cmd.description || '',
            type: 'command',
            score: 1.0
          });
        });
        return suggestions;
      }
    
      // Check if the last part is incomplete (doesn't start with --)
      const lastPart = parts[parts.length - 1];
      const isOption = lastPart.startsWith('--');
      
      if (isOption) {
        return this.getOptionSuggestions(parts);
      } else {
        return this.getCommandSuggestions(parts, context);
      }
    }
  • Helper method for suggesting option completions and values based on partial option name and command context.
    private getOptionSuggestions(parts: string[]): CommandSuggestion[] {
      const suggestions: CommandSuggestion[] = [];
      const lastPart = parts[parts.length - 1];
      const optionName = lastPart.replace(/^--?/, '');
      
      // Find the command these options belong to
      const commandParts = parts.filter(part => !part.startsWith('--'));
      const command = this.parser.findCommand(commandParts);
      
      if (!command?.options) {
        return suggestions;
      }
    
      // Suggest matching options
      command.options.forEach(option => {
        if (option.name.startsWith(optionName)) {
          const fullCommand = commandParts.join(' ');
          const completion = `playground ${fullCommand} --${option.name}`;
          
          suggestions.push({
            completion,
            description: option.description || '',
            type: 'option',
            score: this.calculateScore(option.name, optionName)
          });
    
          // If option has predefined values, suggest them too
          if (option.values) {
            option.values.forEach(value => {
              suggestions.push({
                completion: `${completion} ${value}`,
                description: `${option.description} (value: ${value})`,
                type: 'value',
                score: 0.9
              });
            });
          }
        }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves: no information about response format, error handling, rate limits, authentication needs, or whether it's read-only or mutative. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a simple tool and front-loads the essential information. Every word earns its place in this concise formulation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but doesn't provide enough context about when to use it versus siblings, what the response looks like, or behavioral characteristics. Without annotations or output schema, the description should do more to compensate, but it only meets the minimum viable threshold.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any additional meaning about parameters beyond what's in the schema. It mentions 'partial playground command to complete' which aligns with the schema but provides no extra context about format, examples, or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get command suggestions and completions for the Kafka Docker Playground CLI'. It specifies the verb ('Get'), resource ('command suggestions and completions'), and target system ('Kafka Docker Playground CLI'). However, it doesn't explicitly differentiate from its siblings (playground_command_help, playground_command_validate), which would be needed for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its siblings (playground_command_help, playground_command_validate). It doesn't mention prerequisites, alternatives, or exclusions. The only implied usage is when you have a partial command to complete, but this is insufficient for effective tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vdesabou/kafka-docker-playground-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server