mcp-jena provides 4 SPARQL-focused tools with schemas and descriptions present, but exhibits significant gaps in parameter documentation, output schema clarity, and error handling guidance. Tool names are verb-based and clear (execute_sparql_query, execute_sparql_update, list_graphs, sparql_query_templates). Descriptions are substantial (200-400+ chars) and educationally thorough for SPARQL syntax, but do not guide LLM tool selection (missing WHEN to use, prerequisites, or differences between similar operations). Parameters are typed but lack descriptions in the base tool definitions visible in src/utils/sparql-query-tool.ts, endpoint and dataset params appear undescribed in the handler schemas. Output schemas are not documented anywhere; callers cannot know field structure for chaining. Error handling is minimal (status/error wrapped returns) without recovery guidance or classification. Security: credentials (JENA_USERNAME, JENA_PASSWORD) are environment-injected (good), but no mention of scope declarations, audit logging, or input validation. Composition is weak, execute_sparql_query and execute_sparql_update operate on the same resource but lack clear guidance on which to choose or how to chain them. The sparql_query_templates tool is discovery-oriented but its input schema in src/index.ts is not visible in the code sample, making full assessment impossible.
Execute a SPARQL query against an Apache Jena dataset. SPARQL (SPARQL Protocol and RDF Query Language) is a query language for RDF data. Key SPARQL Query Forms: - SELECT: Returns variable bindings as a table - CONSTRUCT: Returns RDF triples - ASK: Returns true/false - DESCRIBE: Returns RDF description of resources Basic SPARQL Syntax: - PREFIX declarations: PREFIX ex: <http://example.org/> - WHERE clause with triple patterns: ?subject ?predicate ?object - Optional patterns: OPTIONAL { ?s ?p ?o } - Filters: FILTER(?var > 10) - Graph patterns: GRAPH <uri> { ?s ?p ?o } - Property paths: ?s ex:knows/ex:friend ?o (sequence), ?s ex:knows* ?o (zero or more) Common Query Templates: 1. Basic exploration: SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10 2. Count triples: SELECT (COUNT(*) as ?count) WHERE { ?s ?p ?o } 3. List types: SELECT DISTINCT ?type WHERE { ?s a ?type } 4. Property path (friends of friends): SELECT ?person ?friend WHERE { ?person foaf:knows/foaf:knows ?friend } 5. Optional properties: SELECT ?s ?name WHERE { ?s a ex:Person . OPTIONAL { ?s foaf:name ?name } } 6. Named graph query: SELECT ?s ?p ?o FROM NAMED <graph> WHERE { GRAPH <graph> { ?s ?p ?o } } 7. Filter by value: SELECT ?s WHERE { ?s ex:age ?age . FILTER(?age > 18) } Property Path Operators: - / (sequence): ?s foaf:knows/foaf:name ?name - | (alternative): ?s (foaf:name|rdfs:label) ?name - * (zero or more): ?s foaf:knows* ?connected - + (one or more): ?s ex:partOf+ ?container - ? (zero or one): ?s foaf:knows? ?maybeKnown - ^ (inverse): ?s ^ex:hasChild ?parent (equivalent to ?parent ex:hasChild ?s) - ! (negation): ?s !(rdf:type) ?notType
Execute a SPARQL update query against an Apache Jena dataset. SPARQL Update Operations: - INSERT DATA: Add triples to the dataset - DELETE DATA: Remove specific triples - INSERT/DELETE WHERE: Conditional insert/delete based on patterns - LOAD/CLEAR: Load/clear entire graphs - CREATE/DROP: Manage graph lifecycle Basic Update Syntax: - INSERT DATA { <subject> <predicate> <object> } - DELETE DATA { <subject> <predicate> <object> } - INSERT { ?s <new:prop> "value" } WHERE { ?s <old:prop> ?o } - DELETE { ?s <old:prop> ?o } WHERE { ?s <old:prop> ?o } - CLEAR GRAPH <graph-uri> Example Updates: 1. Insert data: INSERT DATA { <ex:person1> foaf:name "John" ; ex:age 25 } 2. Delete data: DELETE DATA { <ex:person1> ex:age 25 } 3. Conditional update: DELETE { ?p ex:status "pending" } INSERT { ?p ex:status "active" } WHERE { ?p ex:status "pending" } 4. Insert with graph: INSERT DATA { GRAPH <ex:metadata> { <ex:dataset1> dcterms:created "2024-01-01"^^xsd:date } } 5. Clear graph: CLEAR GRAPH <ex:temporary>
Parameter descriptions are missing or minimal in tool definitions. The 'endpoint' parameter appears in handler signatures but is not described in input_schema properties visible in src/utils/sparql-query-tool.ts. LLMs cannot infer when to use a custom endpoint vs the default.
Output schemas are not documented. Tools return {status, data/message/graphs, error} but LLMs cannot see the structure of 'data' or 'graphs' fields or what fields they contain. This breaks tool chaining and forces LLMs to guess field names.
Error handling provides no recovery guidance. Tools return {status: 'error', error: errorMessage} but do not classify errors as retryable vs terminal, or suggest next steps (e.g., 'Syntax error, review SPARQL grammar or call sparql_query_templates for examples').
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 51 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 44 | - | v1 |
List all available named graphs in an Apache Jena dataset. Named graphs in RDF provide context and provenance for triples. Each graph is identified by a URI. This tool helps discover what data contexts are available in your dataset. Common Graph Patterns: - Default graph (unnamed): Contains triples not in any specific graph - Named graphs: <http://example.org/graph1>, <http://data.gov/dataset1> - Metadata graphs: Often contain information about other graphs - Versioned graphs: <http://data.org/v1>, <http://data.org/v2> Use Case Examples: - Data provenance: Track where data came from - Temporal data: Different time periods in separate graphs - Access control: Different permissions per graph - Data quality: Separate validated vs raw data
Get SPARQL query templates for common knowledge graph exploration patterns. This tool provides pre-built SPARQL query templates covering: - Basic data exploration and statistics - Property path navigation for complex relationships - Knowledge graph analysis patterns - Data validation and quality checks - Schema discovery and documentation Templates include explanations and can be customized with your specific URIs and requirements.
Tool descriptions are educational (SPARQL syntax) but do not explain WHEN or WHY to call a tool vs alternatives. No guidance on tool selection (when to use execute_sparql_query vs sparql_query_templates). Missing prerequisites or dependencies.
sparql_query_templates tool schema not visible in code sample. Input schema properties are not shown, preventing full validation of parameter types and descriptions. Score capped at 50 for inferred definitions.
No pagination or result limiting documented for tools that return lists (e.g., list_graphs, SPARQL SELECT results with large datasets). Large result sets can overflow context windows.
No input validation or sanitization described. SPARQL injection is possible if user input is not properly escaped. No mention of how to safely handle user-supplied SPARQL queries or dataset names.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint) present. Clients cannot detect that execute_sparql_query is read-only or that execute_sparql_update is destructive without parsing descriptions.