Skip to main content
Glama

render_battlefield

Visualize combat scenarios in text-based grids to display participant positions, obstacles, and terrain for tactical planning.

Instructions

Render an ASCII map of the current combat state showing participant positions, obstacles, and terrain. Returns a text-based grid visualization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encounterIdYes
showLegendNo
showCoordinatesNo
showElevationNo
viewportNo
focusOnNo
legendDetailNostandard

Implementation Reference

  • Registration of the 'render_battlefield' MCP tool. Defines name, description, input schema (using imported renderBattlefieldSchema), and handler function that parses input with the schema and executes renderBattlefield(validated) to generate the result.
    render_battlefield: {
      name: 'render_battlefield',
      description: 'Render an ASCII map of the current combat state showing participant positions, obstacles, and terrain. Returns a text-based grid visualization.',
      inputSchema: toJsonSchema(renderBattlefieldSchema),
      handler: async (args) => {
        try {
          const validated = renderBattlefieldSchema.parse(args);
          const result = renderBattlefield(validated);
          return success(result);
        } catch (err) {
          if (err instanceof z.ZodError) {
            const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ');
            return error(`Validation failed: ${messages}`);
          }
          const message = err instanceof Error ? err.message : String(err);
          return error(message);
        }
      },
    },
  • The MCP tool handler for render_battlefield. Validates arguments using renderBattlefieldSchema and calls the core renderBattlefield function with validated args, returning success(result). Handles Zod validation errors and other exceptions.
    handler: async (args) => {
      try {
        const validated = renderBattlefieldSchema.parse(args);
        const result = renderBattlefield(validated);
        return success(result);
      } catch (err) {
        if (err instanceof z.ZodError) {
          const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ');
          return error(`Validation failed: ${messages}`);
        }
        const message = err instanceof Error ? err.message : String(err);
        return error(message);
      }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the output format ('text-based grid visualization') without disclosing behavioral traits like whether it's read-only, requires specific permissions, has rate limits, or how it handles errors. It mentions what is shown but not operational constraints or side effects.

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 front-loaded and concise with two sentences that efficiently convey core functionality and output format. Every sentence earns its place by stating the action and result without unnecessary elaboration or redundancy.

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

Completeness2/5

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

Given the complexity (7 parameters, nested objects, no output schema) and lack of annotations, the description is incomplete. It covers the basic purpose and output type but misses critical context like parameter meanings, behavioral constraints, and how the visualization integrates with other tools, making it inadequate for full agent understanding.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter semantics beyond the required 'encounterId' implied by 'current combat state'. It doesn't explain the purpose of parameters like 'showLegend', 'viewport', or 'focusOn', leaving 7 parameters largely undocumented in both schema and description.

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

Purpose5/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 with specific verbs ('render an ASCII map') and resources ('current combat state'), listing key elements shown (participant positions, obstacles, terrain). It distinguishes from siblings like 'get_encounter' or 'manage_location' by focusing on visual representation rather than data retrieval or management.

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

Usage Guidelines3/5

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

The description implies usage for visualizing combat state, but provides no explicit guidance on when to use this tool versus alternatives like 'get_encounter' for raw data or 'measure_distance' for spatial calculations. No exclusions or prerequisites are mentioned, leaving usage context inferred rather than stated.

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/Mnehmos/mnehmos.chatrpg.game'

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