Skip to main content
Glama

Extract entities

ai_extract_entities
Read-onlyIdempotent

Extract emails, URLs, phone numbers, dates, money amounts, percentages, hashtags, mentions, IPs, IBANs and masked card numbers from text or files, with deduplicated counts for structured analysis.

Instructions

Pull structured items out of text or a text file, deduplicated with counts: emails, URLs, phone numbers (libphonenumber, validated, E.164 plus type/country; local numbers read with defaultRegion, default JO), dates (ISO, D/M/Y or M/D/Y, Y/M/D, English month names; normalised to YYYY-MM-DD; a date like 03/04/2024 is flagged ambiguous with the other reading), money ($, €, £, JOD/JD/د.أ, SAR/ر.س, AED/د.إ, KWD, EGP… and Arabic currency words, with amount and ISO currency), percentages, #hashtags, @mentions, IPv4/IPv6, IBANs (country length and mod-97 checked) and card-like numbers (only Luhn-valid ones with a known brand prefix, always masked: only the last 4 digits are shown, the full number is never returned). Arabic-Indic digits are understood. Regex-based, not NLP: no names, places or organisations. Give "text" or "path" (file path or base64).

Input Schema

NameRequiredDescriptionDefault
pathNoOr: a UTF-8 text/markdown file, as a local path or base64 (raw or a data: URI).
textNoThe text (inline).
typesNoOnly these types (default all): emails, urls, phones, dates, money, percentages, hashtags, mentions, ipv4, ipv6, ibans, cards.
maxPerTypeNoMost unique items to return per type. Default 500.
defaultRegionNoTwo-letter country for local phone numbers, regional currencies (dinar, riyal…) and D/M/Y vs M/D/Y. Default JO.JO

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Goes well past the readOnly/idempotent annotations: results are deduplicated with counts, card-like numbers are only returned when Luhn-valid with a known brand and are always masked to the last 4 digits ('the full number is never returned'), IBANs get country-length and mod-97 checks, and ambiguous 03/04/2024 dates are flagged with the alternate reading. That is exactly the kind of privacy and validity context annotations cannot convey.

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?

Front-loaded with the core action and input options, and nearly every clause carries operational meaning. The long currency enumeration ('$, €, £, JOD/JD/د.أ, SAR/ر.س, AED/د.إ...') is the one place where detail could be compressed without losing agent-relevant information.

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?

For a tool with no output schema, it does a good job describing the shape of results (per-type, deduplicated, counted, masked cards) and the date/phone normalization rules. It stops short of specifying the exact response envelope, so an agent still cannot predict the precise JSON structure.

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 the baseline is 3. The description explains what defaultRegion actually changes (local phone parsing plus D/M/Y vs M/D/Y disambiguation) and that outputs are deduplicated, but it largely restates the schema's own parameter descriptions rather than adding new semantics for 'types' or 'maxPerType'.

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?

Opens with a concrete verb and resource ('Pull structured items out of text or a text file') and then enumerates exactly which entity classes are recognized, so an agent knows precisely what comes back. The closing 'Regex-based, not NLP: no names, places or organisations' draws a sharp boundary that separates it from true NER/OCR-style siblings.

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?

States the input contract plainly ('Give "text" or "path" (file path or base64)') and rules out a whole use case up front with 'no names, places or organisations'. It does not name an alternative sibling (e.g. ai_ocr for images, text_social_count for social stats), so the when-to-use-differently guidance is implied rather than explicit.

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

Deploy Server

Other Tools