Skip to main content
Glama

mask_code

Mask code identifiers and literals before sending prompts to LLMs, replacing sensitive values with synthetic tokens while preserving grammar; optionally mask numbers and set language or SQL dialect.

Instructions

Mask identifiers/literals. Set language explicitly when auto detection is ambiguous.

Numbers are preserved by default; mask_numbers=True opts into numeric masking. Supported language profiles are listed in privacy://policies and docs/LANGUAGES.md. SQL dialect: standard (lowercase folding), postgresql, sqlite. Generated code is a review representation; it is not executable anonymization.

Input Schema

NameRequiredDescriptionDefault
codeYes
languageNoauto
strategyNobracket
session_idNo
sql_dialectNosqlite
mask_numbersNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.5.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does reasonably well: it discloses that numbers are preserved unless mask_numbers=True, enumerates valid SQL dialects, and warns that output is a review representation rather than executable anonymization. It does not state whether the call is purely computational or whether session_id causes state to be recorded, which is the main remaining behavioral unknown.

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?

Five short lines, front-loaded with the action, then the parameter caveats, then the resource pointer, then the safety caveat. Every sentence carries distinct information and nothing is repeated from the schema.

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?

An output schema exists, so return values need not be described, and the description covers the operation, its defaults, and the non-executable nature of the result. The gaps around strategy and session_id are the notable shortfall for a six-parameter privacy tool with zero annotation coverage.

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 description coverage is 0% across six parameters, so the description must compensate and only partially does: it explains language selection, the mask_numbers default behavior, and the three sql_dialect values. The strategy parameter (default "bracket") and session_id receive no explanation at all, even though strategy plausibly controls the shape of the masked output.

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?

"Mask identifiers/literals" states a specific verb and resource for a code-oriented masking tool, which is clear on its own. However, it never distinguishes itself from the sibling mask_text, leaving an agent to guess whether the difference is code-aware parsing or just input type.

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?

"Set language explicitly when auto detection is ambiguous" gives one actionable rule for choosing a parameter value, but there is no guidance on when to pick mask_code over mask_text, nor on how this interacts with the privacy session tools listed as siblings.

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