Skip to main content
Glama

ScorpTech x402 Tools

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}. Returns JSON with: mode, root, namespaces, count, nodes, truncated. Price: $0.003 USDC per successful call (x402, Base or 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.1/5.0
Behavior4/5

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

Beyond the readOnly/idempotent/non-destructive annotations it adds real behavioral context: safe parser with no network, no external entity resolution, rejected DTD entities, namespace auto-registration with default namespace bound to prefix d, and per-call pricing. The only soft tension is 'no network' against openWorldHint=true, but that hint describes open-ended input space rather than outbound fetching, so it is not a contradiction. It stops short of describing pagination/limit behavior or truncation thresholds for the overall response.

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?

Purpose and return shape are front-loaded, and each sentence carries information (inputs, return fields, safety, price, endpoint). It is dense and the pricing/HTTPS sentence at the end is somewhat promotional, but nothing is a true throwaway.

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 correctly enumerates the return envelope fields (mode, root, namespaces, count, nodes, truncated) and the node payload (paths, text, attributes, outer markup), which is what an agent needs to consume results. The remaining gap is the exact relationship between the single xpath and the named xpaths object in the response, plus how limit/truncation interact.

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 86%, so the schema already explains most parameters and the baseline is 3. The description adds genuine value on namespaces (auto-registration, default namespace as prefix d) and restates the {xml or html, xpath} input contract, but says nothing about limit, outerXml, or the multi-expression xpaths object.

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?

The description opens with a specific verb and resource ('Run XPath 1.0 queries over XML you supply ... or over HTML'), enumerates concrete document types (RSS/Atom, SOAP, sitemaps, SVG, config) and names the output form. An agent can immediately tell this is an XML/HTML query engine rather than any of the unrelated sibling math tools.

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?

It gives clear usage context: use xml for structured feeds/docs, html for scraping with a lenient parser, and it states the invocation shape (POST JSON with either xml or html plus xpath). It does not give explicit when-not-to-use conditions or point at an alternative tool, but with the sibling set being unrelated arithmetic utilities no meaningful alternative exists.

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