Skip to main content
Glama

sparql_ask

Read-onlyIdempotent

Check if a pattern exists in SPARQL data by running an ASK query, returning true or false.

Instructions

Execute a SPARQL ASK query and return a boolean result.

ASK queries test whether a pattern exists in the data, returning true or false.

Args: params: Query parameters including endpoint URL, SPARQL ASK query, timeout, and optional headers.

Returns: "true" if the pattern exists, "false" otherwise.

Examples: >>> # Check if a specific item exists >>> sparql_ask(SparqlAskInput( ... endpoint="https://query.wikidata.org/sparql", ... query="ASK { wd:Q42 wdt:P31 wd:Q5 }" ... )) "true"

>>> # Check if a relationship exists
>>> sparql_ask(SparqlAskInput(
...     endpoint="https://query.wikidata.org/sparql",
...     query="ASK { wd:Q42 wdt:P27 wd:Q142 }"
... ))
"true"

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 declare readOnly, idempotent, openWorld hints. The description adds behavioral details: returns a string 'true'/'false', includes timeout parameter with default/max values, and provides examples that illustrate idempotent behavior. No contradiction 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, structured with Args/Returns/Examples, and uses a clean docstring format. Every sentence adds value, and the examples are relevant without redundancy.

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?

Given the complexity of SPARQL and available sibling tools, the description adequately covers the tool's function, parameters, and return type. It lacks explicit differentiation from sibling tools but is sufficient for an ASK-specific tool. Output schema presence reduces burden.

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 0% (top-level params object lacks description), but each sub-parameter has schema descriptions. The tool description lists parameter names (endpoint, query, timeout, headers) but provides no additional semantics beyond what the schema already covers. Baseline 3 is appropriate.

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 clearly states it executes a SPARQL ASK query returning a boolean result, with specific examples. It distinguishes from sibling tools (e.g., sparql_query) by focusing on ASK semantics, making its purpose unambiguous.

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?

The description implies usage for pattern existence checks but does not explicitly compare to alternatives like sparql_query or provide when-to-use/when-not-to-use guidance. No exclusion criteria or sibling reference is given.

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