Skip to main content
Glama

enum-canonicalize

Map free-text values onto a closed set of allowed values, or abstain — Maps each input string onto one member of a closed caller-supplied set using, in order: exact match, caller aliases, a deterministic normal form (Unicode NFKC, case and accent folding, punctuation and underscore collapse), then bounded edit distance (optimal string alignment, so a swapped pair of letters costs 1). Returns the canonical value, the method, the distance and the nearest candidates; it

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": {
      "values": "<values>",
      "allowed": "<allowed>"
    },
    "name": "enum-canonicalize"
  }
}

Input Schema

NameRequiredDescriptionDefault
valuesYesStrings to canonicalize.
aliasesNoCaller synonyms; each canonical must be in allowed.
allowedYesThe closed set of canonical values.
maxDistanceNoLargest edit distance accepted (default 2). The effective limit is also capped at one third of the normalized input length.
caseSensitiveNoSkip case, accent and punctuation folding (only NFKC and whitespace collapse). Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the ordered match strategy, the exact normalization steps (NFKC, case/accent folding, punctuation collapse), the edit-distance metric (optimal string alignment, with the transposition cost noted), and the shape of the result. Remaining gaps are the abstain outcome and error behavior, plus the fact that the final sentence is cut off mid-thought.

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

Conciseness3/5

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

The structure is good, leading with a one-line summary then elaborating the pipeline, and most sentences carry information. However, the description ends in a dangling clause ('; it'), which is a real defect in presentation and leaves a promised detail unread.

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 five-parameter tool with no output schema and no annotations, a fair amount is covered, but the truncated ending suggests unfinished disclosure, and the abstain result (what a caller receives when nothing matches) is never stated. An agent can invoke it correctly but cannot fully predict the response.

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 every parameter is already documented, including maxDistance's default and its one-third-length cap. The description adds only marginal meaning, notably that caller aliases are consulted after exact match but before normalization and fuzzy matching, which is an ordering fact the schema does not convey.

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 opening clause states a specific verb and resource: mapping free-text strings onto a caller-supplied closed set, with an explicit abstain path. That is enough to tell it apart from a sibling like url-canonicalize, which is scoped to URLs.

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 'or abstain' phrasing and the ranked matching ladder imply the intended context (messy values needing reconciliation against a known vocabulary), but there is no explicit when-to-use, when-not-to-use, or comparison against alternatives. Guidance is inferable rather than stated.

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.

Resources