Skip to main content
Glama
web-algebra-mcp

web-algebra-mcp

Official
by AtomGraph

SPARQLString

Converts natural language questions into SPARQL queries for a specified endpoint using an LLM and optional context, then validates parsing and required projections.

Instructions

    Writes a SPARQL query for an endpoint from a natural language question, using an LLM.
    `projection` names the variables the query must project (because what follows reads them from its rows).
    `context` holds operations (e.g. a SELECT that inventories predicates, or looks a label up) whose
    results are shown to the model as what the endpoint holds, before it writes the query.
    A query that does not parse or lacks the projection goes back to the model, a few times at most.
    

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": {
      "endpoint": "<endpoint>",
      "question": "<question>"
    },
    "name": "SPARQLString"
  }
}

Input Schema

NameRequiredDescriptionDefault
contextNoOperations whose results show the model what the endpoint holds.
endpointYesThe SPARQL endpoint the query is for.
questionYesThe natural language question to convert into a SPARQL query.
projectionNoVariable names the query must be a SELECT projecting.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.4

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden, and it does add real behavior: LLM-driven generation, model-visible context operations, and bounded retries when a query fails to parse or misses the projection. It still leaves key operational facts unstated, most notably whether the generated query is executed against the endpoint or only returned, and whether any auth/latency/cost characteristics apply.

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 purpose is front-loaded in the first sentence, and the following sentences each cover a distinct concern (projection purpose, context purpose, retry behavior). There is minor wordiness in the parentheticals, but nothing is redundant enough to cut.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a four-parameter tool with no annotations and no output schema, the description covers inputs and failure behavior fairly well. The notable gap is the return value: it never states whether the output is the SPARQL string alone or also the query results, which an agent must know before chaining this into a subsequent execution step.

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 already 100%, so the baseline would be 3, but the description adds genuine meaning beyond the schema: it explains *why* `projection` is mandatory ('what follows reads them from its rows') and that `context` operations are surfaced to the model as evidence of endpoint contents before generation. That rationale is not present in the schema and materially affects how an agent should supply those arguments.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Writes a SPARQL query for an endpoint from a natural language question, using an LLM.' That is far more precise than the bare name and tells an agent this is query-generation, not query execution. It does not explicitly contrast itself with siblings like SELECT or CONSTRUCT, so the differentiation is inferable rather than stated.

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

Usage Guidelines3/5

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

Usage is implied by the framing (you have a natural language question and an endpoint, and need a query), and the description explains why `projection` and `context` matter in that workflow. However, it never says when to pick this over the several query-execution siblings such as SELECT, CONSTRUCT, or DESCRIBE, and gives no exclusion conditions.

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