Skip to main content
Glama

sparql_construct

Read-onlyIdempotent

Execute a SPARQL CONSTRUCT query to build RDF graphs from a template pattern and return triples in Turtle or JSON-LD format.

Instructions

Execute a SPARQL CONSTRUCT query and return RDF triples.

CONSTRUCT queries build an RDF graph from a template pattern. Results are returned as Turtle RDF or JSON-LD. For large-scale graph construction, increase the timeout parameter — default is 30s, maximum is 3600s (1 hour).

Args: params: Query parameters including endpoint URL, SPARQL CONSTRUCT query, timeout, output format, optional headers, and max rows limit.

Returns: RDF triples formatted as Turtle or JSON.

Examples: >>> # Construct a subgraph >>> sparql_construct(SparqlConstructInput( ... endpoint="https://query.wikidata.org/sparql", ... query="CONSTRUCT { wd:Q42 rdfs:label ?name } WHERE { wd:Q42 rdfs:label ?name . FILTER(LANG(?name) = 'en') }" ... )) "@prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .\n..."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already indicate read-only, idempotent, non-destructive behavior. The description adds context: it explains the CONSTRUCT query nature, mentions default and maximum timeout, and specifies output formats (Turtle or JSON). No contradictions with annotations.

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 description is well-structured: purpose, explanation, argument list, return, and example. It is reasonably concise with no redundant sentences, though the example could be shortened.

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?

Given the complexity of SPARQL CONSTRUCT and the presence of six sibling tools, the description covers the main output but does not explain how it differs from sparql_describe (another RDF graph tool). The example is helpful, but a brief comparison would improve completeness.

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?

Despite the schema coverage being 0% (per context), the description lists the included parameters (endpoint, query, timeout, output format, headers, max rows) and provides a concrete example. This adds meaning beyond the bare schema structure, which lacks parameter descriptions.

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 clearly states 'Execute a SPARQL CONSTRUCT query and return RDF triples' and explains that CONSTRUCT queries build an RDF graph. It implicitly distinguishes from siblings like sparql_query (returns tabular) and sparql_ask (boolean) by focusing on graph construction, but does not explicitly name alternatives.

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

Usage Guidelines2/5

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

The description provides no when-to-use or when-not-to-use guidance relative to sibling tools. It only gives a performance tip ('increase timeout for large-scale graph construction'), but fails to advise when to prefer this tool over sparql_describe or sparql_query.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/daedalus/mcp-sparql'

If you have feedback or need assistance with the MCP directory API, please join our Discord server