Skip to main content
Glama

Analyze Battle

analyze_battle
Read-onlyIdempotent

Turn battle logs into post-match reads (teams, KOs, speed, damage) and infer opponent sets from observed actions.

Instructions

Pokémon Champions battle analysis, dispatching on mode: "replay" turns a Showdown-format battle log into a deterministic post-match read (teams, KOs, observed Speed order, damage percentages, type read), "infer" runs reverse constraint solving on battle observations to narrow an opponent’s set. Each mode carries the same documented fields the dedicated tools had. Read-only and offline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
logNo
modeYesWhich operation to run: "replay", "infer", "scout".
teamNoYour team with its real sets — the Speed reference and the attackers’ damage math need them.
detailNoHow much detail to return: "compact" (default) gives conclusions and the numbers needed to reason; "evidence" adds ranges, benchmarks and per-row detail; "debug" adds provenance and every intermediate. Ask for more only when the reasoning actually needs it — model context is the expensive resource.
speciesNo
regulationNo
observationsNoWhat the player saw, applied in order; later observations narrow earlier results.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv8.0.2
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / detail
      Added value: +{
      +  "description": "How much detail to return: \"compact\" (default) gives conclusions and the numbers needed to reason; \"evidence\" adds ranges, benchmarks and per-row detail; \"debug\" adds provenance and every intermediate. Ask for more only when the reasoning actually needs it — model context is the expensive resource.",
      +  "enum": [
      +    "compact",
      +    "evidence",
      +    "debug"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / log
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "The battle log text, exactly as exported (lines beginning with |), e.g. from Showdown or a Champions client export.",
      +      "type": "string"
      +    },
      +    {
      +      "description": "The battle log text, exactly as exported (lines beginning with |).",
      +      "type": "string"
      +    }
      +  ]
      +}
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "Which operation to run: \"replay\", \"infer\", \"scout\".",
      +  "enum": [
      +    "replay",
      +    "infer",
      +    "scout"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / observations
      Added value: +{
      +  "description": "What the player saw, applied in order; later observations narrow earlier results.",
      +  "items": {
      +    "anyOf": [
      +      {
      +        "properties": {
      +          "kind": {
      +            "const": "speed",
      +            "type": "string"
      +          },
      +          "referenceSpeed": {
      +            "description": "The Speed of the member it raced against.",
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "relation": {
      +            "description": "\"outsped\" means it moved first; \"outspeeds\" means your member moved first.",
      +            "enum": [
      +              "outsped",
      +              "outspeeds"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "referenceSpeed",
      +          "relation"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "properties": {
      +          "kind": {
      +            "const": "damageDealt",
      +            "type": "string"
      +          },
      +          "move": {
      +            "description": "The move it used.",
      +            "type": "string"
      +          },
      +          "percent": {
      +            "description": "Damage as a percentage of the target’s HP.",
      +            "type": "number"
      +          },
      +          "target": {
      +            "properties": {
      +              "ability": {
      +                "type": "string"
      +              },
      +              "championsPoints": {
      +                "additionalProperties": {
      +                  "type": "number"
      +                },
      +                "propertyNames": {
      +                  "type": "string"
      +                },
      +                "type": "object"
      +              },
      +              "evs": {
      +                "additionalProperties": {
      +                  "type": "number"
      +                },
      +                "propertyNames": {
      +                  "type": "string"
      +                },
      +                "type": "object"
      +              },
      +              "item": {
      +                "type": "string"
      +              },
      +              "level": {
      +                "maximum": 9007199254740991,
      +                "minimum": -9007199254740991,
      +                "type": "integer"
      +              },
      +              "nature": {
      +                "type": "string"
      +              },
      +              "species": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "species"
      +            ],
      +            "type": "object"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "move",
      +          "target",
      +          "percent"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "properties": {
      +          "attacker": {
      +            "properties": {
      +              "ability": {
      +                "type": "string"
      +              },
      +              "championsPoints": {
      +                "additionalProperties": {
      +                  "type": "number"
      +                },
      +                "propertyNames": {
      +                  "type": "string"
      +                },
      +                "type": "object"
      +              },
      +              "evs": {
      +                "additionalProperties": {
      +                  "type": "number"
      +                },
      +                "propertyNames": {
      +                  "type": "string"
      +                },
      +                "type": "object"
      +              },
      +              "item": {
      +                "type": "string"
      +              },
      +              "level": {
      +                "maximum": 9007199254740991,
      +                "minimum": -9007199254740991,
      +                "type": "integer"
      +              },
      +              "nature": {
      +                "type": "string"
      +              },
      +              "species": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "species"
      +            ],
      +            "type": "object"
      +          },
      +          "kind": {
      +            "const": "damageTaken",
      +            "type": "string"
      +          },
      +          "move": {
      +            "description": "The move that hit it.",
      +            "type": "string"
      +          },
      +          "percentTaken": {
      +            "description": "Damage it took, as a percentage of its own HP.",
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "move",
      +          "attacker",
      +          "percentTaken"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "properties": {
      +          "ability": {
      +            "description": "An ability it is known to have.",
      +            "type": "string"
      +          },
      +          "kind": {
      +            "const": "ability",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "ability"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "properties": {
      +          "item": {
      +            "description": "An item it is known to hold.",
      +            "type": "string"
      +          },
      +          "kind": {
      +            "const": "item",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "item"
      +        ],
      +        "type": "object"
      +      }
      +    ]
      +  },
      +  "maxItems": 8,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / regulation
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "Regulation id, e.g. \"m-c\"; scopes which curated meta set anchors the prior.",
      +      "type": "string"
      +    },
      +    {
      +      "description": "Regulation id, e.g. \"m-c\"; scopes the meta prior for the inference.",
      +      "type": "string"
      +    }
      +  ]
      +}
    • addedInput schema / properties / species
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "The opponent’s species as observed, e.g. \"Sneasler\", \"Salamence-Mega\"; resolves case- and punctuation-insensitively.",
      +      "type": "string"
      +    },
      +    {
      +      "description": "The opponent species to scout, e.g. \"Sneasler\"; must appear on the opposing side of the log.",
      +      "type": "string"
      +    }
      +  ]
      +}
    • addedInput schema / properties / team
      Added value: +{
      +  "description": "Your team with its real sets — the Speed reference and the attackers’ damage math need them.",
      +  "items": {
      +    "properties": {
      +      "ability": {
      +        "description": "Ability, canonical spelling when known.",
      +        "type": "string"
      +      },
      +      "championsPoints": {
      +        "additionalProperties": {
      +          "type": "number"
      +        },
      +        "description": "Pokémon Champions stat points keyed by stat id, 0-32 each, 66 total; present when the spread was parsed as point-scale — values that all fit 0-32 and total at most 66, or an explicit SP line.",
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "evs": {
      +        "additionalProperties": {
      +          "type": "number"
      +        },
      +        "description": "EVs keyed by stat id, 0-252; present when the spread was parsed as EV-scale.",
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "item": {
      +        "description": "Held item, canonical spelling when known.",
      +        "type": "string"
      +      },
      +      "ivs": {
      +        "additionalProperties": {
      +          "type": "number"
      +        },
      +        "description": "IVs from an IVs line, keyed by stat id.",
      +        "propertyNames": {
      +          "type": "string"
      +        },
      +        "type": "object"
      +      },
      +      "level": {
      +        "description": "Level when the paste stated one; Champions always plays at 50.",
      +        "maximum": 9007199254740991,
      +        "minimum": -9007199254740991,
      +        "type": "integer"
      +      },
      +      "moves": {
      +        "description": "Moves in paste order, canonical spelling when known.",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "nature": {
      +        "description": "Nature as supplied.",
      +        "type": "string"
      +      },
      +      "species": {
      +        "description": "Species as the dataset resolves it, e.g. \"Rotom-Wash\", \"Salamence-Mega\"; the spelling supplied is kept when the species is unknown.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "species"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 6,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / required
      Added value: +[
      +  "mode"
      +]
  2. Addedv6.2.2

TDQS

A3.6/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, and destructiveHint false, and the description adds 'offline' and 'deterministic', which are behavioral traits not present in the annotations. It accurately describes the read-only nature of the operation and does not contradict any annotation. The claim that each mode carries the same documented fields as dedicated tools is vague, but the safety profile is well disclosed.

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

Conciseness4/5

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

The description is a compact two-sentence summary that front-loads the tool's purpose and dispatch pattern. The phrase 'Each mode carries the same documented fields the dedicated tools had' is vague and arguably does not earn its place, but the overall text is appropriately sized and scannable.

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?

For a tool with seven parameters and no output schema, the description covers the replay and infer modes with output summaries, but it entirely omits the `scout` mode found in the schema enum. The rich schema descriptions and annotations compensate for parameter-level detail, but the missing mode and the opaque reference to 'dedicated tools' leave the description with clear gaps.

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?

The description enriches the meaning of the `mode` parameter by explaining what replay and infer do, which goes beyond the schema enum. However, it does not discuss `scout`, nor does it describe parameters like `log`, `team`, `observations`, `detail`, `species`, or `regulation`; the schema already provides descriptions for those, so the description adds only modest value. The omission of the `scout` value is a notable gap given it is part of the enum.

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 identifies the tool as battle analysis and explains two dispatch modes with concrete outputs: replay produces a post-match read and infer narrows an opponent's set via constraint solving. However, it omits the `scout` mode that appears in the schema enum, and it does not differentiate the tool from siblings like analyze_team or analyze_meta. It is clear on the main modes but incomplete on the full mode surface.

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 provides conditional guidance: use `replay` when you have a Showdown-format battle log, and use `infer` when you have battle observations to constrain an opponent's set. It does not say when to prefer this tool over the sibling tools, and its reference to 'the dedicated tools' is vague. Usage guidance is implied rather than comparative.

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