Skip to main content
Glama

Keyword density: top keywords and phrases of a text or page

text_keyword_density
Read-only

Keyword density of a text or a web page: the most frequent words and two-word phrases (English stop words removed), each with its count and share of all words, plus total and unique word counts. Give text, or a URL whose readable text is used (HTML, up to 1 MB). Use for SEO copy checks, comparing a page against a target keyword, or summarising what a page is about; for readability use text_stats. Example: text=Agents pay per call. Agents pay with USDC. Pay per call tools for agents.. Price $0.04/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
topNoHow many keywords and phrases to return, 1-50 (default 15)
urlNoA page URL to analyse instead of text
textNoThe text (up to 50,000 characters); or give url instead

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds the operational details that matter: input caps (HTML up to 1 MB, text up to 50,000 chars), stop-word removal, and a clear cost model (price per call, first 25 free, failed calls free, repeats not free). It also notes the call is charged per invocation, which is consistent with idempotentHint=false.

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 definition and outputs, then inputs, then use cases, then pricing. Dense but largely earning its place; the inline example sentence is the weakest element and could be trimmed without losing meaning.

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 still specifies the return shape (each keyword with count and share, plus total and unique counts), the input formats, limits, and cost. It also covers the zero-required-parameter edge case by telling the agent to supply either text or url.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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, but the description adds meaning the schema doesn't: phrases are capped at two words, English stop words are removed, and results are ranked by frequency with share-of-all-words. Remaining gaps are minor, such as how 'top' behaves when fewer items are available.

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?

States a specific verb+resource (compute keyword density) plus the exact outputs (words, two-word phrases, counts, share, total/unique counts), and explicitly distinguishes itself from text_stats for readability. An agent can tell it apart from the other text_* siblings without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names concrete use cases (SEO copy checks, comparing against a target keyword, page summarisation) and explicitly routes the readability case to text_stats. It also states the input rule: give text, or a URL, not both.

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