Skip to main content
Glama

sparql_query

Runs a read-only SPARQL 1.1 SELECT or ASK query against the Artsdata Knowledge Graph (https://query.artsdata.ca/query) and returns the result as SPARQL 1.1 Query Results JSON, exactly as the endpoint returns it: head.vars and results.bindings for SELECT, boolean for ASK. Call get_schema first and build the query from the classes, properties, prefixes and conventions it returns, since Artsdata's model is not general knowledge. Declare every PREFIX you use and always add a LIMIT: at most 1000 rows are returned (the rest is cut and truncated is true; page with OFFSET), and a query gets 25 seconds. If the endpoint rejects the query, its error message is returned so you can fix the query and retry. For the details of an entity URI in the results use get_entity; to find an entity's URI from its name use search_entities. Always SELECT the entity URI next to its label so its Artsdata ID can be cited. Entity URIs end in the Artsdata ID (K\d+-\d+, e.g. K12-345); cite it with the entity name. To find who claims a property value, see the sources guidance in the get_schema conventions.

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": {
      "query": "<query>"
    },
    "name": "sparql_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesA complete SPARQL 1.1 SELECT or ASK query, with a PREFIX declaration for every prefix it uses. Build it from the classes, properties and prefixes returned by get_schema, and add a LIMIT.

Output Schema

NameRequiredDescriptionDefault
headYes
booleanNoThe answer to an ASK query.
resultsNo
truncatedNoPresent and true when the endpoint returned more rows than the server's row cap and only the first rows are included. Add or lower the LIMIT, or page with OFFSET.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so: read-only constraint, 1000-row cap with a `truncated` flag and OFFSET paging, 25-second timeout, and that endpoint error messages are returned verbatim for retry. This is stronger behavioral disclosure than most annotated tools provide.

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-loaded with purpose, endpoint, and return shape, then constraints, then sibling routing — a sensible ordering with no filler sentences. It is dense and near the upper bound of acceptable length; the Artsdata-ID citation guidance is useful but borders on tangential for a query tool.

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

Completeness5/5

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

Even though an output schema exists, the description still explains the SELECT/ASK result shapes, truncation and timeout semantics, error behavior, and the sibling tools for follow-up — leaving nothing an agent needs in order to call this correctly or recover from failure unstated.

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 100% and there is only one parameter, so the baseline is 3; the description nonetheless adds real semantics the schema lacks — every PREFIX must be declared, a LIMIT is mandatory, and the query should be built from get_schema output. Format/conventions added beyond the schema description earn a bump.

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 ('Runs a read-only SPARQL 1.1 SELECT or ASK query against the Artsdata Knowledge Graph'), names the endpoint, and makes clear it is a raw query tool rather than the entity lookup siblings (get_entity, search_entities). An agent can distinguish it from every sibling without opening a schema.

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?

Explicitly routes work: 'Call get_schema first' before writing a query, 'For the details of an entity URI... use get_entity', and 'to find an entity's URI from its name use search_entities'. It also states the prerequisite (Artsdata's model is not general knowledge), which is the key when-to-use condition.

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.