Skip to main content
Glama
MatthiasVanDE

jena-mcp-server

write_graph

Replace or merge RDF data in a named graph to keep versioned schemas in sync. Supply inline content or a file, choosing replace to overwrite or merge to append.

Instructions

Replace or extend one named graph with RDF you supply.

mode "replace" (the default) makes the graph exactly what you send: whatever was in it is gone. mode "merge" adds to what is there.

Replacing per graph is how a versioned schema is kept in sync -- one graph per module, so that updating one cannot wipe another.

Give the RDF either inline (content) or from a file (file). Prefer the file for anything beyond a handful of triples: it goes straight to the server instead of through the conversation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoPath in the sandbox. Use this or content, not both.
modeNo"replace" (PUT, default) or "merge" (POST).
graphNoGraph IRI. Omit to target the default graph.
contentNoRDF as text. Use this or file, not both.
datasetNoDataset name. Defaults to the configured one.
content_typeNoMedia type. Inferred from the extension when a file is used.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it flags that replace is destructive ('whatever was in it is gone'), declares replace as the default, and explains that file payloads bypass the conversation and go straight to the server. It omits permissions/auth requirements and any indication of what a call returns or how failures manifest.

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?

Front-loaded with the core action, then structured into short paragraphs that each cover one decision (mode, per-graph versioning rationale, payload source). No filler sentences.

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?

For a six-parameter mutation tool with no annotations and no output schema, the description covers the destructive/default behavior and payload choice well. It does not describe the response, error conditions, or required permissions, which leaves minor gaps for a write operation.

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 already 100%, so the baseline is 3, but the description adds genuine meaning: mode's replace/merge semantics and default, the mutual exclusivity of content and file, and the practical preference for file on larger payloads. Only content_type and dataset get no elaboration beyond the schema.

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 (write/replace/extend) and resource (a named graph) with RDF payload, and distinguishes itself from siblings like sparql_update (which it frames as per-graph replacement) and read_graph/drop_graph. An agent can tell what this does without opening the schema.

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

Usage Guidelines4/5

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

Gives explicit mode semantics (replace is the destructive default, merge is additive) and a clear rule for choosing file vs inline. It stops short of naming sibling alternatives such as sparql_update or drop_graph, so a routing decision between write_graph and a generic SPARQL update is left to inference.

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