Skip to main content
Glama

run_battle

Execute a 1v1 battle between two strategies using their IDs or custom JavaScript code. Returns winner, remaining HP, and total turns.

Instructions

Run a 1v1 battle between two strategies. You can specify strategies by ID (from the available list) or provide custom strategy code. Returns the winner, final HP, and total turns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hpNoHP for the battle (50-1000). Default: 100. Tournament mode uses 250.
strategyANoCustom JavaScript code for strategy A. Must include '// Strategy Name: ...' comment and a 'function strategy(state) { ... }' function.
strategyBNoCustom JavaScript code for strategy B. Must include '// Strategy Name: ...' comment and a 'function strategy(state) { ... }' function.
strategyIdANoID of strategy A (from list_strategies). Use this OR strategyA code.
strategyIdBNoID of strategy B (from list_strategies). Use this OR strategyB code.
includeTurnLogNoIf true, includes the full turn-by-turn log. Default: false (for shorter responses).
Behavior4/5

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

With no annotations, the description carries the burden. It explains the action (run battle), optional turn log, and return values. It does not mention side effects, auth requirements, or error handling, but the behavior is clearly a simulation with no persistent state changes.

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 three sentences, front-loaded with the main purpose and key options. It is compact, readable, and contains no unnecessary information.

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

Completeness4/5

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

Given no output schema, the description adequately explains the return values (winner, HP, turns) and optional includeTurnLog. It does not cover error conditions or rate limits, but for a simulation tool with no required params, it is sufficiently complete.

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 coverage is 100%, so the schema already documents parameters well. The description adds overall context (returns winner, HP, turns) and the includeTurnLog option, but does not add significant meaning beyond the schema descriptions. Baseline 3 is appropriate.

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 runs a 1v1 battle between strategies, specifying the options (by ID or custom code) and the return values (winner, HP, turns). This distinguishes it from sibling tools like run_tournament, which runs multiple battles.

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

Usage Guidelines4/5

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

The description mentions using list_strategies to get IDs and provides an alternative of custom code. It implicitly suggests when to use this tool (single battle) vs run_tournament (multiple battles). However, it does not explicitly state when not to use it or provide exclusions.

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/Oscarlight/battle-arena-mcp'

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