Skip to main content
Glama

Xml Xpath

xml_xpath
Read-onlyIdempotent

Run XPath 1.0 queries over XML you supply (RSS/Atom, SOAP, sitemaps, SVG, config) or over HTML for scraping: returns matched elements/attributes/text with their paths, text, attributes and outer markup, or the number/string/boolean result of an expression. Namespaces are auto-registered (default namespace as prefix d). Safe parser: no network, no external entities, DTD entities rejected. POST JSON body {xml or html, xpath}. Price: $0.003 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/xml-xpath

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "xml_xpath"
  }
}

Input Schema

NameRequiredDescriptionDefault
xmlNoXML document
htmlNoHTML document (lenient parser), alternative to xml
limitNo
xpathNoXPath 1.0 expression
xpathsNoSeveral named expressions {"name": "xpath"} (max 20)
outerXmlNoInclude each element's markup (truncated to 2000 chars)
namespacesNoExtra prefix -> namespace URI bindings

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond annotations: discloses parser safety guarantees (no network, no external entities, DTD entities rejected), automatic namespace registration with the default namespace bound to prefix 'd', result shape (paths, text, attributes, outer markup), and payment terms ($0.003 USDC via x402 on Solana, HTTPS endpoint). Annotations only cover readOnly/idempotent/destructive/openWorld, so this adds substantial operational context.

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-loads the core action and keeps to a single dense paragraph with no filler. It is somewhat run-on (safety, namespaces, pricing, and transport all chained together), which slightly hurts scannability but every clause carries real 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?

With no output schema, the description does a good job explaining return values (node sets with path/text/attributes/markup, or number/string/boolean). It leaves the 'limit' and 'xpaths' parameters unexplained and does not describe pagination/truncation policy beyond the schema, so it is near-complete rather than fully complete.

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 86%, so the baseline is 3; the description adds meaning beyond the schema by explaining namespace auto-registration behavior (default namespace → 'd') and the JSON body shape combining xml/html with xpath. It does not explain limit, xpaths, or outerXml semantics, leaving that to the schema.

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 resource ('Run XPath 1.0 queries over XML/HTML') and enumerates the concrete document families it targets (RSS/Atom, SOAP, sitemaps, SVG, config, scraped HTML). This clearly separates it from neighbors like html_select, html_tables, or jsonpath without needing to open the schema.

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?

Gives clear usage context: XML/HTML input via {xml or html}, scraping-oriented HTML parsing, and both node-set and scalar XPath result modes. It does not explicitly name alternatives (e.g., html_select, jsonpath) or when not to use this tool, so it falls short of a 5.

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