Skip to main content
Glama

run_sparql

Execute SPARQL queries on biological and biomedical RDF databases. Choose a single database or use an endpoint for cross-database queries.

Instructions

Run a SPARQL query on an RDF database. ALWAYS pass database (required; valid values: uniprot, rhea, pubchem, pdb, chembl, chebi, reactome, ensembl, amrportal, mesh, go, taxonomy, mondo, nando, bacdive, mediadive, clinvar, pubmed, pubtator, ncbigene, medgen, ddbj, glycosmos, supercon, bgee, oma, brenda, hgnc, jpostdb, massbank, nbrc, mogplus, hco, mco, togovar, ontology) for single-database queries. For cross-database queries on a shared endpoint, still pass a member database AND add endpoint_name (valid values: sib, pubchem, pdb, ebi, primary, ncbi, ddbj, glycosmos, nims, togovar) or endpoint_url, which take priority over database. Invalid database/endpoint_name values fail immediately with a deterministic error — do not retry. RETURNS the query results as a CSV-formatted string (first row is the header of SELECT variable names).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoAlias for `sparql_query`.
databaseYesName of a single RDF database. Must be exactly one of: uniprot, rhea, pubchem, pdb, chembl, chebi, reactome, ensembl, amrportal, mesh, go, taxonomy, mondo, nando, bacdive, mediadive, clinvar, pubmed, pubtator, ncbigene, medgen, ddbj, glycosmos, supercon, bgee, oma, brenda, hgnc, jpostdb, massbank, nbrc, mogplus, hco, mco, togovar, ontology. Do NOT pass an endpoint group name here (e.g. 'ebi', 'sib') — those go in endpoint_name instead.
endpoint_urlNoDirect SPARQL endpoint URL. Use this for explicit control over the endpoint.
sparql_queryNoThe SPARQL query to execute. Alias: `query`.
endpoint_nameNoEndpoint name for cross-database queries. One of: sib, pubchem, pdb, ebi, primary, ncbi, ddbj, glycosmos, nims, togovar. Use this when querying multiple databases on the same endpoint.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/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. It discloses that the tool returns CSV-formatted results and that invalid inputs cause deterministic errors. However, it does not explicitly state that the operation is read-only (non-destructive), which would be helpful for an agent to assess safety.

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 a single paragraph that is front-loaded with the primary action. It is reasonably concise, but could be more structured (e.g., separating error handling into a distinct sentence) to improve scanability. Nevertheless, every sentence adds value.

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?

Given the tool's complexity (5 parameters, cross-database queries, error handling) and the absence of an output schema, the description fully covers all necessary aspects: input parameters, valid values, error behavior, return format (CSV), and aliases. It leaves no ambiguity for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, yet the description adds significant meaning by explaining the relationship between 'database' and 'endpoint_name/endpoint_url', clarifying aliases ('query' for 'sparql_query'), and specifying valid values for both parameters. This goes well beyond what the schema provides.

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 the primary action: 'Run a SPARQL query on an RDF database.' It provides specific verbs and resources, and distinguishes itself from sibling tools like get_sparql_endpoints by focusing on query execution rather than endpoint retrieval.

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?

Explicit instructions are given: always pass a database, for cross-database queries add endpoint_name or endpoint_url. It also explains error behavior ('Invalid database/endpoint_name values fail immediately with a deterministic error — do not retry'), which provides clear guidance on when to use alternatives and how to handle failures.

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/dbcls/togomcp'

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