Skip to main content
Glama

HTML to text extraction module with pytest tests

submit_html_text_extraction
Idempotent

Produce a standard-library Python module that extracts readable text from an HTML fragment, plus pytest tests. Choose this when you need the visible text of an HTML fragment with tags removed, script and style contents dropped, entities unescaped and whitespace collapsed, delivered as a module with tests. Do not choose this when you need a parsed DOM, CSS-selector queries, or a faithful browser rendering: the result is a text approximation, not a parsed document. Use a full HTML parser for that. Example requests: Write a Python module that strips HTML tags from a fragment and returns the plain text, with tests. | I need to turn an HTML snippet into readable text, dropping script and style blocks. | Generate an HTML-to-text module and prove it with pytest.

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": {
      "inputs": "<inputs>",
      "authorized_by": "<authorized_by>"
    },
    "name": "submit_html_text_extraction"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputsYes
quote_idNoThe quote_id returned by POST /v1/jobs. Required to authorize a priced capability; the service rejects a priced job that does not name the quote it issued.
authorized_byYesIdentifier of the human or agent authorizing this job.
accepted_priceNoThe amount accepted, exactly as quoted (for example "5.00" or 5). Checked against the stored quote, so a price that moved between quote and authorize is refused rather than silently absorbed. Optional, but sent to make the acceptance explicit.

Output Schema

NameRequiredDescriptionDefault
quoteNo
stateYes
job_idYes
artifactsNo
access_tokenNoPer-job credential. Present it as the X-Job-Token header to read the job or list it. Keep it; it is the only credential for this job.
verificationNoIndependent verification. verification.ok = false means the job failed, not a partial success.
capability_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, idempotentHint=true, destructiveHint=false and openWorldHint=false, and the description adds the substantive behavioural contract of the output: it is a text approximation, not a parsed document, with script/style content dropped and whitespace collapsed. It does not disclose that this is a priced job submission gated on a quote and authorization, but that machinery is documented in the schema fields, so the gap is narrow rather than disqualifying.

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 core purpose is front-loaded in the first sentence, and the exclusion clause follows immediately, so the structure is sound. It runs long, though: three example requests largely restate the already explicit when-to-use sentence and could be trimmed without loss.

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?

With an output schema present, the description needn't explain return values, and it does cover the behavioural contract of the generated module plus its boundaries. The one material omission is that it never signals this is an asynchronous, quote-authorized job submission rather than an immediate transformation, which affects how an agent plans the call.

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 75% and each property (template, module_name, function_name, quote_id, authorized_by, accepted_price) carries its own description, so the baseline is 3. The prose adds no parameter-level guidance beyond implying that a module and tests are emitted; it never explains the template selector's "html-to-text" constraint or the naming rules for module_name/function_name that the schema enforces.

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 and artifact (produce a standard-library Python module that extracts readable text from HTML, plus pytest tests) and enumerates the exact transformation semantics: tags removed, script/style dropped, entities unescaped, whitespace collapsed. It also draws a boundary against neighbouring concerns (parsed DOM, CSS selectors, browser rendering), so an agent can separate it from submit_text_parser_module and submit_markdown_table_rendering without opening schemas.

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?

Gives an explicit when-to-use clause ("Choose this when you need the visible text of an HTML fragment..."), an explicit when-not clause ("Do not choose this when you need a parsed DOM, CSS-selector queries, or a faithful browser rendering"), and names the alternative course of action ("Use a full HTML parser for that"). Three example requests illustrate the routing decision in natural language.

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