Skip to main content
Glama

Invert a JSON string map

bpj_json_invert_string_map
Read-onlyIdempotent

Group original keys under each mapped string value, retaining collisions.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "map": "<map>"
    },
    "name": "bpj_json_invert_string_map"
  }
}

Input Schema

NameRequiredDescriptionDefault
mapYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, closed-world, non-destructive, so safety is covered. The description adds one genuine behavioral detail beyond that: collisions are retained, implying duplicate values are grouped rather than overwritten. It does not say what the retained-collision output looks like (arrays?) or whether non-string values are rejected.

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?

A single dense sentence with no filler, and the collision-retention caveat is placed where it matters. It is efficient, though the terseness leaves the input format unexplained rather than front-loaded.

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 one-parameter pure function with rich safety annotations and no output schema, the definition is minimally adequate: it explains the transform and collision handling. It omits the serialization format of the input and the shape of the result (grouped arrays vs. single values), which an agent would need.

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?

With one parameter and 0% schema description coverage, the description must carry the load. It implies the input is a mapping of keys to string values, which adds some meaning, but never states that the argument is a JSON-encoded string (maxLength 5000) rather than an object, nor how it must be formatted — a critical detail for correct invocation.

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 states a specific transformation: group original keys under each mapped string value, i.e. invert a key→string mapping. Combined with the title 'Invert a JSON string map', an agent can identify the operation precisely. It does not name a sibling it is distinguished from, so it stops short of 5.

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?

There is no guidance on when to use this versus other JSON transform siblings (e.g. bpj_json_zip_keys_values), no prerequisites, and no statement about input validity. Usage is only implied by the operation's name and description.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.