Skip to main content
Glama

Detect PII

detect_pii
Read-onlyIdempotent

Detect personally identifiable information (PII) in text.

Finds emails, phone numbers, SSNs, credit cards, IP addresses, and person names. Optionally returns redacted text with PII replaced by type labels (e.g. [EMAIL], [PHONE]). BERT-NER + regex ensemble.

Args: text: Text to scan for personally identifiable information. redact: If true, return redacted text with PII replaced by [TYPE].

Returns: dict with keys: - pii_found (list): Detected PII items, each containing: - text (str): The PII value found - type (str): PII type (EMAIL, PHONE, SSN, CREDIT_CARD, IP, PERSON) - start (int): Character offset start - end (int): Character offset end - score (float 0-1): Detection confidence - count (int): Total PII items found - redacted_text (str|null): Text with PII replaced (when redact=true) - has_pii (bool): Whether any PII was detected

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to scan for personally identifiable information
redactNoIf true, return redacted text with PII replaced by [TYPE]

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior. The description adds useful behavioral detail beyond those annotations, such as the BERT-NER + regex ensemble approach and the redaction output behavior. It does not discuss model limitations or edge cases, but for a read-only detection tool the disclosure is adequate.

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 well structured: a front-loaded summary, an Args section, and a detailed Returns section. It is somewhat verbose and the Args section duplicates schema descriptions, but each section is scannable and contributes to the agent's understanding of the tool.

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

Completeness5/5

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

With no output schema, the description fully documents the return structure, including keys, types, offsets, confidence scores, and redaction behavior. It also covers the input and optional redaction flag. For a read-only PII detection tool, this is sufficiently complete for an agent to invoke it correctly.

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 100%, so the schema already documents both parameters. The Args section mostly restates the schema, though the Returns section clarifies the practical consequence of setting redact=true. This is a solid baseline-3 case: no parameter meaning is missing, but the description adds little beyond the schema.

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 states the action and resource: detect PII in text, and explicitly lists the PII types covered (email, phone, SSN, credit card, IP, person name). It is specific and unambiguous, but it does not explicitly differentiate itself from the sibling tool detect_conversational_pii, so it stops short of a 5.

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 gives clear usage context: call this tool when text needs PII detection, with an optional redaction mode. It does not explicitly state when not to use it or how to choose between detect_pii and detect_conversational_pii, but the capability statement is direct enough that an agent can infer the primary use case.

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.

TDQS

A3.6/5.0
Disambiguation4/5

Most tools map cleanly to distinct capabilities, and the descriptions make the intended use clear. A few adjacent pairs—extract_entities vs link_entities_to_wikidata and detect_pii vs detect_conversational_pii—require careful selection, but they are distinguishable by their stated outputs.

Naming Consistency4/5

Names are uniformly lowercase snake_case and mostly follow a verb_object pattern, such as analyze_*, detect_*, extract_*, summarize_text, and translate_text. A few outliers like aspect_sentiment, fraud_feedback, and knowledge_ingest break the verb-first feel, but the overall pattern remains predictable.

Tool Count3/5

At 22 tools, this is on the heavy side of the borderline range. Each tool has a distinct job, but the mix of core NLP, safety, fraud, health-checking, and knowledge-base management makes the surface feel sprawling rather than tightly scoped.

Completeness3/5

The core NLP coverage is broad: sentiment, toxicity, PII, entities, QA, summarization, translation, and groundedness are all present. However, the knowledge-base tools support ingest/list/query but no delete or update, creating a dead end when documents need correction or removal.

Resources