Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Connecting AI assistants (MCP)

Agrafe is a remote Model Context Protocol server. An MCP client such as Claude can read your deployed ontologies, run SPARQL queries against them and read your project glossaries, with your own permissions.

What it exposes

ResourcesOne per deployment you can access: schema://ontology/{deployment_id}, the ontology as Turtle. Titled <project> v<version>; the description lists the concepts (up to 20 by name), the property count and the triple counts. Plus one per project with Live view on: schema://ontology/project/{project_id}, titled <project> (live), the Turtle of the project’s current files (what preview_turtle shows), with _meta.basis set to the live basis. Reading it needs mcp:query; with Live view off it answers a JSON-RPC error whose data is the live_view_disabled refusal, and a project you cannot see answers not-found.
Tool list_projectsOptional query, include_shared (default true) and folder. Lists your projects and the projects shared with you, deployed or not: an undeployed project has deployments: [], which is why list_deployments does not show it. Each entry has project_id (the id get_project, get_glossary, draft_mapping and list_deployments take), name, comment (the package.dlf description), role (owner, editor or viewer), owner (display name, else email), public, package_iri and package_version (null when package.dlf has none), folder_id (null at the root), created_at, modified_at and deployments ([{deployment_id, version, active}]). query keeps the projects whose name or comment contains it, ignoring case, like the search box of the Projects page. include_shared: false keeps your own projects. folder is a folder id (an entry’s folder_id) and keeps the projects directly in that folder, not in its subfolders; folder names are not unique, so names and paths are not accepted.
Tool get_projectArgument project_id. Returns the list_projects entry plus file_count (the files shown in the tree: package.dlf and source Turtle files are not counted), limits (the owner’s plan, as a shared project counts against its owner: plan, write_allowed, and files and deployments as {used, max, remaining}, max and remaining being null when unlimited; files.used counts package.dlf, as the file limit does), import_locks ({locked, entries, imports: [{import_iri, requested_version, locked_at}]}, see imports) and git_sync (the Git panel’s status: remote, branch, status, last error, unpushed work and changes since the last checkpoint; never the deploy key; null when the server has no git sync or the project is not connected, see git sync).
Tool create_projectArguments name and package_iri, optionally package_version (default 0.1.0), dolfin_version (default 1), description, author (default: your display name), folder and idempotency_key. Creates a private project, as New project on the Projects page does, and writes its package.dlf as the ⚙ Package pane writes it (see package.dlf for the fields). package_iri is required, because Deploy needs a package name: an IRI such as https://example.org/app or a dotted name such as com.example.app. A missing or invalid one is refused before anything is created, with {"error": "invalid_argument", "argument": "package_iri", …}. description is {lang: text} ("" for the untagged entry) or a plain string. folder is a folder id, or the name of one of your folders (refused when several share it). Requires projects:write. When your plan’s project limit is reached, the refusal has rule: "limit", required: {"limit": "projects", "max": …, "settings": "/settings/license"} and a message pointing at Settings → License. A retry with the same idempotency_key returns the same project and does not count against the limit again. Returns project_id, name, files: ["package.dlf"] (it is hidden from the file tree, but it is there), package (as get_package) and diagnostics (the package checker’s errors, normally []).
Tool get_packageArgument project_id. The project’s package settings, read from its hidden package.dlf: name (the package name, as in the Package pane), version, dolfin_version, rdf_version ("1.1" or "1.2", "1.1" when the line is absent; a hand-written invalid value, which the checker rejects, is returned as written), author, description ({lang: text}, "" for the untagged entry), package_iri (as in list_projects), imports (the raw import lines; see imports) and content_version, the version update_package takes. Requires files:read; any role can read.
Tool update_packageArguments project_id and expected_version (get_package’s content_version), and any of name, version, dolfin_version, rdf_version, author, description and message (shown in History). rdf_version is "1.1" or "1.2" exactly (see rdf_version); any other value is refused with {"error": "invalid_argument", "argument": "rdf_version", …} and nothing is written; "1.1" removes the line. Saves package.dlf as the Package pane does: only the fields you pass change, other lines (imports included) stay as they are. description replaces the whole map: pass every language you want to keep, or omit description to leave it untouched. name changes the package name only, never the project name (rename the project on the Projects page). A stale expected_version answers a conflict. A change the package checker rejects is refused and nothing is written. Like the Package pane, the save then re-locks the imports; imports_sync lists each import line’s lock status. Returns the new package (as get_package), imports_sync and diagnostics. Bump version here before update_deployment. Requires projects:write and the owner or an editor with Pro.
Tool rename_projectArguments project_id and name (not empty or blank). Renames the project, as renaming it on the Projects page does. While the project’s package.dlf is still exactly as it was created (a package name derived from the old project name, nothing edited), its package name follows the new project name; an edited package.dlf is left alone (change it with update_package). See package.dlf for the fields. Returns {project_id, name, previous_name}. An empty name is refused with {"error": "invalid_argument", "argument": "name", …}. Audited as ProjectRenamed with the old and new names, when the name changes. Requires projects:write and the project owner.
Tool set_project_publicArguments project_id and public (true or false). Makes the project public (read-only to anyone on /public, as the Public switch does) or private again. Only a private → public change counts against your plan’s public-project limit: when it is reached, the refusal has rule: "limit", required: {"limit": "public_projects", "max": …, "settings": "/settings/license"} and a message pointing at Settings → License. Turning it off, or setting the value it already has, is never refused by the limit. An expired licence refuses the change to public with rule: "plan"; a project importing a release of a private project cannot be made public. Returns {project_id, public, changed}. Audited as ProjectVisibilityChanged (old_public, new_public) when it changes. Requires projects:write and the project owner.
Tool move_project_to_folderArguments project_id and folder_id: a folder id (as list_projects’ folder_id), or null for the root. Required: leaving it out is refused, so a typo never moves a project to the root. Moves the project into that folder, last among its items, as dropping it on the folder does. A folder that is not yours, or does not exist, and a malformed id are refused with {"error": "invalid_argument", "argument": "folder_id", …}. Returns {project_id, folder_id, previous_folder_id} (null = root). Audited as ProjectMoved (old_folder, new_folder, root for the root) when the folder changes. Requires projects:write and the project owner.
Tool list_collaboratorsArgument project_id. Lists the project’s collaborators, as the Share dialog does: [{share_id, invite_email, role, accepted}], role viewer or editor, accepted false while the invitation is pending. invite_email is the address you typed. Requires projects:write and the project owner.
Tool invite_collaboratorArguments project_id, email and role (viewer or editor). Invites the address, as the Share dialog does, and sends the same invitation email: a sign-up link for an address without an account, an in-app invitation otherwise (emailed, unless they had another invitation recently). The answer has the same shape either way. Inviting a current member or a pending address again (with or without an account) keeps the same share_id, sends no new email and only changes the role when it differs; only a sign-up invite whose 24-hour link has expired is replaced, with a new share_id, a new email and status sent. Returns {share_id, invite_email, role, accepted, status}, status sent (new invitation), updated (role changed) or unchanged. Sharing needs a Pro plan: otherwise the refusal has rule: "plan", required: "pro" and a message pointing at Settings → License. A bad role or an empty email is refused with {"error": "invalid_argument", "argument": …}; inviting yourself is an error. Audited as CollaboratorInvited (email, role, status) when the status is sent or updated. Requires projects:write and the project owner.
Tool remove_collaboratorArguments project_id and share_id (from list_collaborators). Removes the collaborator, or cancels a pending invitation, as the Share dialog’s remove does; a member who had accepted gets the usual removal email. A share_id that is not one of this project’s is an error. Returns {share_id, removed: true}. Audited as CollaboratorRemoved (share_id). Requires projects:write and the project owner. No Pro plan needed.
Tool add_importArgument project_id (the importing project) and exactly one form, as the Package pane’s Imports rows: a release, release_id, or import_project_id and version (from list_releases), writing import <package-iri> "version"; a web import, url and optionally iri (the IRI the import goes by, default the URL), writing import <iri> from <url>; or text, one raw import line (the syntax). Optionally expected_version (get_package’s content_version: a stale one answers a conflict) and message. Saves package.dlf and re-locks as update_package does. An IRI package.dlf already imports has its line replaced (action: "replaced"), never duplicated; the same line again is unchanged. Returns {import_iri, line, action, status, imports, package}: status is this line’s lock status, imports every line’s, package as get_package. A release form locks the release it names, even when another release has the same IRI and version. A text or URL line that several releases match is choice_needed: call add_import again with one candidate’s release_id. A web import is fetched from public addresses only. Requires projects:write and the owner or an editor with Pro.
Tool remove_importArguments project_id and iri (the imported IRI, with or without <>), optionally expected_version and message. Removes its import line from package.dlf and re-locks, which drops its lock (removed). An iri that package.dlf does not import answers {"error": "not_found", "argument": "iri", "imports": [...]} with the current lines. Returns {import_iri, line, removed, imports, package}. Requires projects:write and the owner or an editor with Pro.
Tool relock_importsArgument project_id. Re-locks the imports to the saved package.dlf, as saving the Package pane does, and returns {imports}: every line’s lock status (a lock kept as it was is locked with changed: false) and each dropped lock (removed). Requires projects:write and the owner or an editor with Pro.
Tool list_releasesArgument project_id. Returns importable, the releases the Imports pane’s picker offers this project (from your projects, those shared with you, and public projects, minus the ones this project may not import): {release_id, project_id, project_name, owner, public, package_iri, version, import_line}, public meaning the project is reached only as a public project and import_line the line add_import writes; and own, this project’s releases {release_id, package_iri, version, created_at}, newest first. Requires mcp:read.
Tool create_releaseArgument project_id, optionally version. Creates a release, as the Package pane’s Create release: freezes the saved files under package.dlf’s version. There is no argument to choose the version: set it with update_package first; a version argument is only a check, refused unless it equals package.dlf’s. It needs a clean compile, an absolute package IRI and a version (else {"error": "not_releasable", "message"}); a version already released answers {"error": "conflict"}. With git sync connected, the tag v<version> is added in the background. Returns {release_id, version, package_iri}. Audited. Requires projects:write and the owner or an editor with Pro.
Tool list_filesArgument project_id. Lists every file of the project, sorted by path: path, kind (the lower-case extension: dlf, ttl, md, csv, json, xml, xlsx, …), size (bytes; for a spreadsheet, the size of the workbook, not of its stored form), version (the version read_file returns), modified_at (when the file was last saved), errors and warnings (how many the Problems panel shows for the file: the file’s share of get_problems, same checker, so cross-file, import, rule, S017 data and mapping (S050, S051, counted in the .dlf holding the mapping) problems count; 0 for files the panel does not check, such as CSV or spreadsheets; null when the check is still running and has no earlier result). A .dlf source also has namespace, the IRI its terms are minted under, as a Deploy mints them: it follows from the package IRI and the file’s path (see packages), and is null when package.dlf has no package IRI or the file does not parse. package.dlf is listed with hidden: true (the file tree hides it, get_project’s file_count skips it). In a project imported from Turtle, the original .ttl has origin: true. Requires files:read; any role can read.
Tool read_fileArguments project_id and path (a list_files path, matched exactly), optionally range. Returns content, version and size as the editor shows the file now, live edits included. range is {start_line, end_line}, 1-based and inclusive: only those lines come back (line ends kept), with total_lines and truncated (true when content is not the whole file). end_line may be left out, or be past the end: the read stops at the last line. start_line below 1, end_line before start_line and non-integers are refused. version and size stay the whole file’s, so a later write can pass version as expected_version. A spreadsheet (.xlsx, .xlsm, .ods) has no content: it answers {"kind": "spreadsheet", "sheets": [{"name", "header", "rows"}], "version", "size"}, each sheet with its header row and its first 5 data rows as text, read as a mapping reads them; range does not apply. Files over 5 MiB are refused. A path that is not in the project is a tool error naming it. Requires files:read; any role can read.
Tool list_versionsArgument project_id, optionally path (a list_files path) and limit (default 100, at most 1000). Lists History versions as the History pane does: with path, that file’s; without, the whole project’s, merged newest first, plus its checkpoint groups [{group_id, name, created_at, members: [{path, oid}]}]. Each version is {oid, path, created_at, is_head, retained, tag, group_id}: oid is the History version id, is_head marks the file’s current version, retained is false once it is outside your plan’s retention window, tag holds the via: mcp lines (client, user, message) of a version an assistant wrote (null otherwise), group_id the group it is in. Returns {versions, total} (and groups). An unknown path answers {"error": "not_found", "argument": "path"}. Requires mcp:read; any role can read.
Tool read_versionArguments project_id, path and version (an oid from list_versions). Returns the file’s content at that version, shaped as read_file’s answer plus oid and path. Its version is that content’s hash, equal to read_file’s only when the file still holds that text. A version outside the retention window can still be read. An oid that is not a version of that file (another file’s or another project’s) answers {"error": "not_found", "argument": "version"}. Requires files:read (it returns file content, as read_file); any role can read.
Tool restore_versionArguments project_id, path and version (an oid), optionally expected_version (read_file’s version: a stale one answers a conflict) and message (default restore of <oid>). Restores as the History pane’s Restore: the old content becomes a new version on top, older versions stay (never a rewind). Open editors get it live; History tags it via: mcp; git sync and the Turtle sync see it as a save. A version outside the retention window needs a Pro plan: refused with rule: "plan", required: "pro". Returns {restored, path, from_oid, oid, version}: restored is false when the file already holds that text (nothing is written), oid the file’s head version after the restore, version the new content’s read_file token. An oid of another file is not_found. Audited as VersionRestored. Requires projects:write and the owner or an editor with Pro; a viewer is told an editor is required.
Tool create_checkpoint_groupArguments project_id, name (at most 200 characters) and versions ([{path, version}], 1 to 200, oids from list_versions). Groups those versions under name, as the History pane’s group creation, e.g. MCP: scaffold passe-plat. Grouped versions are kept past the retention window. Returns {group_id, name, members: [{path, oid}]}. A member that is not a version of that project file is not_found. Audited as CheckpointCreated. Requires projects:write and the owner or an editor with Pro.
Tool get_git_statusArgument project_id. The project’s git sync status, as the Git panel shows it: {connected: false} when no repository is connected, else {connected: true, remote_url, branch, path_prefix, status, last_error, last_attempt_at, last_pushed_oid, dirty_since, unpushed_wip, pending_checkpoint, diff_vs_last_checkpoint: {added, modified, deleted}} (the same object as get_project’s git_sync). status is ok, paused, diverged, pending_key, auth_failed, …. The deploy key and the host key are never returned, and remote_url never carries a password. Without git on the server, a tool error says why. Requires mcp:read; any role can read.
Tool git_checkpointArguments project_id and message (1 to 1000 characters, trimmed). Checkpoints now, as the Git panel’s Checkpoint: squashes the work since the last checkpoint into one commit, then pushes it. Returns {commit, push}: commit is the branch tip (null when there was nothing to commit), push is {outcome, error}, or null when no push ran (paused, pending key, diverged). An empty or too long message answers {"error": "invalid_argument", "argument": "message"}. Audited as GitCheckpointed. Requires projects:write and the owner or an editor with Pro.
Tool git_pauseArgument project_id. Pauses git sync, as the Git panel’s Pause: nothing is pushed until git_resume. Returns {status}. Audited as GitSyncPaused. Requires projects:write and the owner or an editor with Pro.
Tool git_resumeArgument project_id. Resumes a paused git sync, as the Git panel’s Resume. Refused when sync is not paused, and when the owner’s plan lacks git sync (rule: "plan"). Returns {status} (ok, or pending_key before the deploy key is added). Audited as GitSyncResumed. Requires projects:write and the owner or an editor with Pro.
Tool add_turtle_sourceArguments project_id, path (a .ttl, .turtle or .n3 name) and content (the Turtle text). Adds the file as a new Turtle source of the project, as the project view’s Add Turtle source: it is translated to Dolfin and its .dlf files are created, or merged into the existing ones; from then on, edits to those files sync back to the Turtle. Returns {source, sources, warnings, diagnostics}: source (and each of sources) is {file_id, path, base_iri, sync_status, sync_message, sync_at, generated_file_ids, generated_files} (generated_files are the .dlf names). A Turtle file that does not translate answers {"error": "bad_content", "file", "message"} (with line:col) and nothing is written. Audited as TurtleSourceAdded. Requires projects:write and the owner or an editor with Pro; the owner’s licence and file limit apply.
Tool retranslate_to_dolfinArgument project_id, optionally file_id (the source’s .ttl file id, required when the project has several sources), dry_run (default true) and selected (file names, with dry_run: false). Re-translates the source’s current Turtle to Dolfin, as the project view’s Re-translate to Dolfin. A dry run writes nothing. Applying writes the selected rows and makes the result the new sync baseline, so the next sync changes nothing. See Turtle sources. Dry run: any role, files:read. Apply: projects:write, the owner or an editor with Pro.
Tool get_problemsArgument project_id, optionally path (a list_files path) and severities (e.g. ["error", "warning"]; values error, warning, info, hint). Returns what the Problems panel shows, from the same checker the editor runs, on the current content (live edits included) with the project’s locked imports loaded, so cross-file references and import errors count: {entries, summary: {errors, warnings}, stale, truncated, fact_error?}. Each entry is {severity, code, file, line, col, end?: {line, col}, message, hint?, fix?: {label, edits: [{file, start_line, start_col, end_line, end_col, replacement}]}, problem_ref}, sorted by file and position. problem_ref is an opaque id of the entry for apply_quick_fix: the same problem at the same place keeps its ref from one check to the next; once the problem is fixed, or moves because the text before it changed, its ref is gone. Lines and columns are 1-based, as the panel shows them. A fix is the panel’s quick fix (and the editor’s: Wrap word in backticks is included); an edit’s file is a list_files path like the entry’s file, and can be another file than the entry’s (for example Declare concept X in file). The S017 data results and the mapping diagnostics (S050, S051) the panel adds after every save are included (see Problems). When that data validation could not run (the project’s sources do not load, e.g. a parse error listed in entries; import data that does not load; a SHACL validation error), fact_error gives the reason as the panel’s note says it: "Data validation failed: …". There are then no S017 entries, and their absence is not evidence that the facts conform. fact_error is absent when the validation ran. It is not filtered by path or severities and does not count in summary. A validation slower than the wait shows as stale: true, not as fact_error. path and severities filter entries; summary always counts the whole project. At most 500 entries come back: beyond that truncated is true and summary still has the full counts. The tool never answers with a half-done check: it waits up to 5 seconds for a running one, and if that is not enough it returns the last complete result with stale: true (call again shortly for a fresh one). For what a code means, see the language reference. An unknown path or severity is a tool error. Requires files:read; any role can read. Every tool that returns diagnostics from this check (write_file, write_files, patch_file, apply_quick_fix, the declaration tools and the Turtle source tools) attaches the same object, fact_error included.
Tool check_dolfinChecks a draft and saves nothing: no file, no history version, no collaborative edit, and get_problems keeps answering for the saved content. Arguments files ([{path, content}], list_files paths, each path once), optionally project_id and base. With base: "project" (the default when project_id is given) the files are laid over the project’s current files, an equal path replacing that file and any other path being added, and the locked imports are loaded: use it for any draft meant for a project, so references such as ingredients.Ingredient to the project’s other files resolve. With base: "empty" (the default without project_id) only the given files are checked, with no imports. Returns {diagnostics, namespaces}: diagnostics is get_problems’ {entries, summary, stale, truncated} (same checker, same codes, 1-based positions, 500-entry cap, stale always false) for every file checked, overlaid project files included, with the mapping diagnostics (S050, S051) but without the S017 data results (those need saved data; get_problems adds them) and never with fact_error. namespaces maps each given .dlf to the namespace IRI a deploy gives it; it is empty unless package.dlf (saved or given) names the package with an IRI. There is no glossary in the result: save, then call get_glossary. At most 200 files and 4 MiB of content per call. base: "project" without project_id, another base, an empty or repeated path is a tool error. Requires files:read; with a project_id, any role on that project can check, even with base: "empty".
Tool get_namespacesExactly one of project_id (the project’s current files, live edits included) and deployment_id (the files frozen at the deployment’s Deploy or last Update; a deployment made before its sources were recorded, or a Turtle-origin one, is a tool error). Tells how the package’s terms are named in RDF, as the compiler names them for a Deploy: {package_iri, files, prefixes, imports, rules, basis}. package_iri is null when package.dlf names the package without an IRI. files lists each .dlf except package.dlf, sorted by path: {path, namespace_iri, dotted_name, iri_name_override?}, namespace_iri being the IRI its terms are minted under (terminator included, null without a package IRI or when the package does not load), dotted_name the module other files reference it by (ingredients in ingredients.Ingredient), and iri_name_override the file’s @iri_name, when it has one. prefixes maps each @prefix of the compiled Turtle (as preview_turtle shows it) to its IRI; {} when the package does not compile. imports has one entry per import line: {iri, version, lock_status, dotted_name, namespaces: [{dotted_name, namespace_iri}]}, lock_status being locked, stale (locked at another version) or not_locked (see imports); both branches read the project’s current locks. rules gives the IRI templates for concept (also fields and properties), enum_variant (<namespace_iri><Concept>_<Variant>) and fact (<namespace_iri><id>, so <package_iri>/data#<id> in data.dlf): see how IRIs are named for the rules and the @iri_name overrides. Requires mcp:read; any role can read.
Tool preview_turtleExactly one of project_id and files ([{path, content}], as check_dolfin: each path once, at most 200 files and 4 MiB), optionally path. Returns, as plain text, the Turtle the Turtle tab shows: with project_id, compiled from the current files (live edits included) with the locked imports; with files, those files alone, with no imports (include a package.dlf). It is the ground truth for the IRIs a Deploy mints. As in the tab, spreadsheet (.xlsx, .ods) mappings are left out, and a # Not in this preview: mapping from <…> as XLSX line on top names each one: their rows are read on Deploy and by live SPARQL. path (a .dlf path) keeps the document header (prefixes and package ontology) and that file’s declarations. A project with no .dlf besides package.dlf gives empty text, as the tab is empty. A compile error is a tool error with the compiler’s message; an unknown path is a tool error too. Saves nothing. Requires files:read; any role can read.
Tool write_fileArguments project_id, path, content and expected_version (required: the version read_file or list_files gave, or null to create a file that must not exist yet), optionally dry_run and message (shown in History). Creates or replaces one file, as a save in the editor: see how writes behave. path is a list_files path with its extension, such as models/recipe.dlf; folders are created as needed. It is refused with {"error": "invalid_argument", "argument": "path", …}, before anything is written, when it starts with . or /, contains .., \ or a control character, has a hidden segment (.x), writes .dlf or .md in upper case, has an extension the file tree does not take, or, for a .dlf, has a segment that is not a valid namespace name (letters, digits, - and _: a source’s path is its namespace; see how IRIs are named; a .dlf whose content starts with a namespace line only needs a safe path, and the refusal ends with “…, or add a namespace line”), or has the namespace of another .dlf of the project (my-file.dlf next to my_file.dlf). A data file (.csv, .json, .xml, .gpx, a spreadsheet) over 5 MiB is refused with argument: "content"; a spreadsheet’s content is its bytes in base64. Creating a file counts against the owner’s file limit (rule: "limit", required: {"limit": "files", …}); replacing one does not. A stale expected_version, null for a file that exists, or a version for a file that does not, answers a conflict with the current content and version. Writing the same content again saves nothing and returns the same version. Writing package.dlf re-locks the imports, as saving the Package pane does: the result then has imports_sync (as update_package) and package_diagnostics (the package checker’s errors). Returns {version, created, diagnostics, diff}: diagnostics is get_problems’ {entries, summary, stale, truncated} with the entries of the whole project, this file’s first (so truncation never cuts them), and its summary, diff a unified diff from the old content (empty for a new file) to the new one. dry_run: true saves nothing, creates nothing and records nothing (no History, no audit, no import re-lock): it answers the same result plus dry_run: true, checked as check_dolfin with base: "project" checks a draft (no S017 data results, nor fact_error). The conflict check still applies. Requires files:write and the owner or an editor with Pro.
Tool upload_data_fileArguments project_id, path, exactly one of text and base64, and expected_version (as write_file), optionally dry_run and message. Creates or replaces one data file (.csv, .json, .xml, .gpx, and .xlsx/.xlsm/.ods where spreadsheets are enabled): write_file with the content given as text or as bytes. See uploading data and writing mappings. Requires files:write and the owner or an editor with Pro.
Tool import_zipArguments project_id, zip_base64 (the zip’s bytes, standard base64, at most 16 MiB compressed and 64 MiB unpacked) and on_conflict (skip or overwrite, required). Imports a project zip as Import → Files does. See importing and exporting zips. Requires files:write and the owner or an editor with Pro.
Tool export_zipArgument project_id. Returns a short-lived download link to the zip that Export as zip builds. See importing and exporting zips. Requires files:read; any role.
Tool write_mappingArguments project_id, file (the target .dlf), data_file (a CSV data file of the project), concept and expected_version (the file’s version, or null to create it), optionally overrides, dry_run and message. Writes the draft_mapping draft as a mapping block in file, and answers write_file’s result plus a preview of the first rows. See uploading data and writing mappings. Requires files:write and the owner or an editor with Pro.
Tool write_filesArguments project_id and files ([{path, content, expected_version}], each item as write_file‘s arguments: null creates), optionally on_conflict (fail, the default, skip or overwrite), dry_run and message (one History message for every file). Writes several files in one call, for a change that spans files. files must not be empty, each path once, at most 200 files and 4 MiB of content in all; a bad path or size is refused as in write_file, with argument naming the item (files[2].path). A conflict is what write_file answers a conflict for (a stale expected_version, null for a file that exists, a version for one that does not). on_conflict is the choice Import gives: fail writes nothing and answers a conflict with conflicts: [{path, content, version}] listing every one; skip writes the other files and reports the conflicting ones as skipped, with their current content and version; overwrite ignores the versions and writes every file (missing ones are created). Not a transaction: storage saves one file at a time, so everything is checked first (arguments, versions, and the file limit for all the files created at once) and nothing is written if a check fails; then the files are saved in order. If a save still fails (a lost connection, say), the files before it stay saved, it is failed with its error, the ones after it are not_written, and complete is false: re-read those and retry them. Returns {files, complete, diagnostics}: one {path, status, version, created, diff} per item, in order, status being created, written, unchanged (same content: nothing saved), skipped, failed or not_written; and one get_problems pass for the whole call, with the entries of the whole project, the saved files’ first, and its summary. Writing package.dlf re-locks the imports once, after all the files (imports_sync, package_diagnostics). dry_run: true saves nothing and answers the same files (as they would be) with the diagnostics of the project with every file laid over it; conflicts are checked the same way. Requires files:write and the owner or an editor with Pro.
Tool patch_fileArguments project_id, path (an existing file) and expected_version (required, a string), exactly one of edits and unified_diff, optionally dry_run and message. Changes part of a text file, safer than write_file while someone else is in it. edits is [{old, new}], applied in order, each on the text the previous ones produced: each old must occur exactly once, byte for byte (line endings included; nothing is normalised). An old found 0 times or 2 times or more fails the whole patch with {"error": "invalid_argument", "argument": "edits", "message": "edits[1].old matches 0 times …; nothing was saved"}; add surrounding lines to make it unique. An empty old is refused. unified_diff is a diff in the usual @@ -a,b +c,d @@ form (the ---/+++ header lines are optional): every hunk’s context and removed lines must match the file exactly at the line it names, or the patch fails with argument: "unified_diff". Passing both or neither is invalid_argument. Spreadsheets cannot be patched: replace them with write_file. A missing file is a tool error; a stale expected_version answers a conflict. The patched file is size-checked like write_file, and patching package.dlf re-locks the imports. Returns {version, created: false, diagnostics, diff} as write_file; dry_run: true saves nothing. Requires files:write and the owner or an editor with Pro.
Tool add_conceptArguments project_id, file (a .dlf path) and name, optionally sub (parent concepts), fields ([{name, type, cardinality?, optional?, list_of?, constraints?, iri_name?, form?}], as add_field takes them, omitted cardinality as in add_field), glossary and form ({key: value}, written as the #@ glossary: / #@ form: blocks), closed_variants (the one of: values), plus the semantic tools’ common arguments. Declares a concept without writing text: it is rendered in canonical Dolfin and placed at the end of the file, after the prefix lines, one blank line apart; existing comments and annotations stay as they are. Refused (argument: "name") when the name is already declared in the file’s namespace, in this file or another one minting terms under the same namespace; a same-named concept in another namespace is fine. A name that is not PascalCase is accepted with a warning. Requires files:write and the owner or an editor with Pro.
Tool update_conceptArguments project_id, file, name and expected_version, and at least one of sub (the parent list; [] removes it), glossary and form ({key: value} replacing that #@ block; null removes it), plus the common arguments. Edits the concept in place: what is not given (fields, comments, other annotations) is kept. It does not rename: the name stays as it is. Requires files:write.
Tool remove_conceptArguments project_id, file, name and expected_version, optionally on_references (fail, the default, or report), plus the common arguments. Deletes the concept with the comment and #@ lines directly above it, without leaving extra blank lines. The answer lists what still uses the concept in the project as references: [{file, line, col, kind, name, context}], where kind and name are the declaration holding the use (fact, rule, query, concept, property…). With fail and references left, nothing is removed and the refusal carries the list; with report it is removed anyway, the list comes back with a warning and diagnostics show the errors it leaves. Requires files:write.
Tool add_fieldArguments project_id, file, concept, name and type, optionally cardinality (one, optional, some, any, N, at least N, at most N, N..M; omitted = required (1..*, like some), except list of (0..1) and set of (0..*); optional and any = may be absent (0..*), see Cardinality), optional (true is cardinality: "optional", 0..*; false removes it and an optional field becomes required; a contradicting cardinality is refused), list_of (true: list of type, which takes no cardinality; with constraints, written list of (type [ … ])), constraints (value comparisons such as ["> 0", "<= 10"]), iri_name (the absolute IRI of the field’s property, written as its @iri_name line) and form ({key: value}, its #@ form: block), plus the common arguments. Appends a has line to the concept’s body, after its other lines (before a one of: block); a body-less concept X gains its colon. Refused when the edit would add a Duplicate property (argument: "name": the concept already has that field, update_field changes it) or an S019 (argument: "iri_name": another field of that name in the file gives another IRI). Requires files:write.
Tool update_fieldArguments project_id, file, concept, name and expected_version, and at least one of add_field’s type, cardinality, optional, list_of, constraints, iri_name and form, plus the common arguments. Each given argument replaces that part of the field, null removes it (type stays); cardinality: null, or optional: false on an optional field, leaves no keyword: the field becomes required (as in add_field); the rest (the # and #@ lines above it, its axioms, a trailing # comment) is kept. It does not rename. Refused on a new S019. Requires files:write.
Tool remove_fieldArguments project_id, file, concept, name and expected_version, plus the common arguments. Deletes the has line with its body (@iri_name, axioms) and the # / #@ lines directly above it. When it was the concept’s last body line, the concept loses its colon. Requires files:write.
Tool add_propertyArguments project_id, file and name, optionally domain and range (a type), domain_card and range_card (cardinalities), sub (a parent property or a list), inverse_of, equivalent_to (a property path), transitive, symmetric, reflexive (true adds the axiom) and iri_name (absolute IRI), plus the common arguments. Declares a standalone property at the end of the file: one-line property p: D -> R when both sides are given (the side cardinalities need that form, else they are refused), domain X / range X body lines otherwise. Refused (argument: "name") when the name is already declared in the file’s namespace, and on S014 (argument: "domain" or "range") when a side is given twice with different types, such as a domain list of two types: write a union (A or B) instead. A repeated identical type is only the S014w warning and is accepted. Requires files:write.
Tool add_enumArguments project_id, file, concept and variants (a list of names), plus the common arguments. Makes the concept closed: writes its one of: block, after its fields; a body-less concept gains its colon. Refused (argument: "concept") when the concept already has one (add_enum_variant adds to it), and on a variant name given twice. The answer adds variants: [{name, iri}] for every variant of the concept, the IRI as the compiler mints it (read from the Turtle of the edited package, as preview_turtle shows it; null when it does not compile). A variant neither UPPER_CASE nor PascalCase is written, with a warning. Requires files:write.
Tool add_enum_variantArguments project_id, file, concept, variants and expected_version, plus the common arguments. Appends the variants to the concept’s one of: block, at its indent. Refused (argument: "variants") on a variant the concept already has, and (argument: "concept") when it has no block (add_enum writes one). Answers variants and warns as add_enum. Requires files:write.
Tool remove_enum_variantArguments project_id, file, concept, variants and expected_version, optionally on_references (fail, the default, or report), plus the common arguments. Deletes the variants; when none is left, the whole one of: block goes (and the colon of a concept left without body). Refused on a variant the concept does not have. references lists what still uses them (facts, rules…), with the same fail / report behaviour as remove_concept. variants lists those left. Requires files:write.
Tool set_annotationArguments project_id, file, target (concept or field), kind (glossary or form), concept, field (with target: "field"), entries ({key: value}) and expected_version, plus the common arguments. Merges entries into the declaration’s #@ glossary: or #@ form: block: a given key replaces its line, null removes it, other lines stay as written; a new block is added above the declaration, an emptied one goes. Keys are those the readers know: glossary label, pref_label, alt_label, definition, scope_note (each may carry a language tag, definition@en); concept form title, display; field form label, placeholder, help, widget, row, col, group (their meaning: annotations, forms). Another key is refused (argument: "entries"). Requires files:write.
Tool apply_quick_fixArguments project_id, problem_ref (from a get_problems entry) and expected_versions, optionally dry_run and message. Applies that entry’s fix, the quick fix the Problems panel offers (Declare concept X, … in file, Create file and declare, Replace with…, Rename to…, Wrap word in backticks, …), and saves the files it edits. The project is checked again first: if no entry has that problem_ref any more (fixed, or moved), it is a tool error, so call get_problems again; an entry without fix is a tool error too, and so is a check still running (retry shortly). expected_versions gives the version of every file in fix.edits, null for a file the fix creates, as {"models/a.dlf": "…"} or [{path, expected_version}]; a missing or stale one is a conflict listing each such file’s current content and version, and nothing is written. The edits are applied to the current content (live edits included), then the files are written exactly as write_files with on_conflict: fail writes them, and the answer is the same, plus fix: {label} and problem_ref. What the fixes change is described in Problems; for the language itself see the language documentation. Requires files:write and the owner or an editor with Pro.
Tool list_deploymentsOptional filters project_id, active and validation_status, combined (all must match). Lists the deployments you can query: deployment and project ids, project name, your role (owner, editor or viewer), version, active (it has a token that is not revoked, as in get_deployment), validation_status, validation_note, creation date and triple counts. Projects without a deployment are not listed: use list_projects. validation_status tells how much of the package the stored SHACL shapes check, read from the deployment without running a validation: ok (every construct is checked), not_checked (some are skipped; validation_note says how many) or unavailable (no usable shapes: the deployment predates validation, or its shapes could not be emitted; validation_note says which). It does not say whether the data conforms: run validate_deployment for that. Any other validation_status value is refused.
Tool get_deploymentArgument deployment_id. Tells whether a deployment still matches its project’s current files: version, active (it has a token that is not revoked), created_at, compiled_from (one {path, hash} per file the deployment was compiled from, hash being sha256: and the hex digest of the file; never the file’s content), differs_from_sources and, when it differs, diff_summary (added, removed and changed paths). The current files are compared as Update would compile them. A deployment made before its sources were recorded has compiled_from and differs_from_sources set to null (unknown); Update it once to record them. See Frozen deployments.
Tool run_sparql_queryArgument query and exactly one of deployment_id or project_id, optionally now (an xsd:dateTime, the time the package’s rules use for now(); see SPARQL). Runs a read-only SPARQL SELECT or ASK query against one deployment, or, with project_id, against the project’s current files compiled on the fly: schema, facts and mapped data, the same store as the SPARQL tab’s Live: current package. The project_id form needs Live view. Both or neither id, a malformed id, query or now is an invalid_arguments refusal; an unknown or inaccessible project or deployment is a project_not_found / deployment_not_found refusal. The rows are not shown in the Instances panel: with project_id, the user can browse the project’s saved data there by picking concepts; it draws their instances and links (that page gives the cap), without unsaved edits or a pinned now, and never a deployment’s data.
Tool run_project_queryArgument query_name (the name of a Dolfin query of the project) and exactly one of deployment_id or project_id, optionally now. Runs that query’s generated SPARQL, the one add_query returns, as run_sparql_query runs a query: same answer, row cap, timeout, scope mcp:query and rate limit. With deployment_id the query is compiled from the deployment’s frozen files, with its IRIs; with project_id from the project’s current files, on the live package, which needs Live view. An unknown query_name is a tool error listing the queries there are; other errors as run_sparql_query. With project_id, the user can browse the project’s saved data in the Instances panel, as for run_sparql_query. Read-only.
Tool explain_factArguments subject, predicate (IRIs: <…>, a bare absolute IRI such as http://… or urn:…, or a prefixed name of rdf, rdfs, owl, xsd or skos such as rdf:type, the form proof nodes print) and object (an IRI or a literal: "v", "v"^^<datatype>, "v"@lang; a plain "v" matches the stored literal by its text, whatever its datatype), exactly one of deployment_id or project_id (the latter needs Live view), optionally cursor (proof index, integer, default 0, at most 200) and now (pins the rules’ clock). Returns one proof of the triple, the tree the Agrafe Why? panel shows: {"proof": …, "next_cursor": k+1}, next_cursor null on the last proof; {"derivable": false} when the fact is not derived; a cursor past the last proof gives {"derivable": true, "proof": null, "next_cursor": null}. Each node has a kind saying where it comes from (chips): File (hand-written facts), Mapping (a mapping’s source file, in origin.open), RuntimeData, Source (unknown origin: every stored fact of the live package), Closure (subClassOf, subPropertyOf, sameAs, inverseOf chain or property path, one child per step), Rule (rule.label, bindings in detail, clock_dependent: true when the rule reads now(), directly or through a rule it reads; absent otherwise), Builtin, Negation or Aggregate. A deep or large proof is cut (truncated). Each call recomputes the proofs before cursor, so later proofs cost more, hence the cap. A negative, non-integer or too large cursor, a malformed term or now, or both or neither id, is an invalid_arguments refusal, never {"derivable": false}; not-found as run_sparql_query. Any other prefix (a project namespace, ex:alice) is not read: it is a tool error {"error":"invalid_argument","argument":…,"rule":"unknown_prefix","message":…}, so write that IRI in full in <…>. A bare http:x without // is rejected the same way; bare urn:, tag:, mailto:, file:, data: and tel: IRIs are kept. A proof the reasoner cannot build is a refusal {"error":"refused","rule":"explain_unsupported","message":…} (also from why_not_fact). Scope mcp:query, same timeout and rate limit as run_sparql_query.
Tool why_not_factArguments project_id (the live package, needs Live view), subject, predicate, object (same term syntax as explain_fact), optionally path (string, a child’s path from a previous answer, default "", the root) and all_fail (boolean, default false). Explains why the triple is not derivable from current data and rules, the tree the Agrafe Why not? panel shows, one level per call: {"path": …, "node": {"summary", "tag", "rule", "all_failing", "conjuncts", "near_misses", "rules", "proofs", "hidden"}, "children": [{"label", "expandable", "path"}]}. Call again with a child’s path (verbatim) to open it; an information-only child has "path": null. With all_fail: true a rule node lists every condition that fails, not only the first; its children’s paths keep that mode (a * after the rule’s index, as in "1*.0"). A fact that holds gives {"derivable": true, "hint": "use explain_fact"}. A malformed path, argument or term is an invalid_arguments refusal; a path with no such child is an explain_unsupported refusal; an unknown or inaccessible project is project_not_found. Each call recomputes the tree down to path. Scope mcp:query, same timeout as run_sparql_query. Read-only.
Tool validate_projectArgument project_id, optionally files ([{path, content}], unsaved content laid over the project’s files as check_dolfin does: same path replaces, new paths are added; same limits) and now. Validates the project’s own facts and mapped data against the SHACL shapes of its current files, without deploying, and returns the same JSON as validate_deployment, with the live basis. Needs Live view. Errors as run_sparql_query.
Tool validate_deploymentArgument deployment_id, optionally now (an xsd:dateTime such as 2026-06-15T12:00:00Z, the time date conditions use). Validates the deployment’s data against the SHACL shapes compiled from its package and returns the same JSON as the validate endpoint: conforms, results, skipped (constructs not checked) and warnings. A deployment made before validation existed answers that it must be redeployed. Errors as run_sparql_query.
Tool deploy_projectArgument project_id, optionally dry_run and idempotency_key. Deploys the project as the Deploy button does (see deployments): it compiles the files as they are saved and publishes them behind a live write API. Each Deploy creates a new id; to change an existing deployment and keep its id, tokens and data, use update_deployment. A project with errors is refused before anything is created, with {"error": "project_has_errors", "summary": {errors, warnings}, "first_errors": […]}, the entries being get_problems’ for the same files. The owner’s plan applies: over the active-deployment limit the refusal has rule: "limit" and required: {"limit": "active_deployments", "max": …, "settings": "/settings/license"}; an expired licence has rule: "plan". dry_run: true creates nothing and returns what the Publish this project? dialog shows: package, version, file_count (files other than package.dlf) and endpoint (POST /api/data/<deployment-id>/triples). Otherwise returns deployment_id, project_id, version, endpoints (triples, sparql, validate, dolfin_file: the data API URLs), triple_counts (schema, fact, data), validation_status and validation_note (as list_deployments), compiled_from (as get_deployment) and basis. The deployment gets its API token as in the UI, but the token value is never returned: copy one from the deployment’s API tokens in Agrafe. A retry with the same idempotency_key within 15 minutes returns the first deployment and creates no other one; the key is yours and per tool, not per project, so use a new key for another project. Dry runs never use the key. IRIs are minted as described in how IRIs are named. Requires deploy:write and the owner or an editor with Pro.
Tool update_deploymentArgument deployment_id, optionally idempotency_key. Updates the deployment in place as the Update button does: the project’s saved files are compiled into the same deployment_id, whose version goes up by one. Its tokens and the data written through the API are kept; the source graphs of mapped data files (CSV, JSON, XML, …) are rebuilt, and remapped_sources lists those files. A project with errors is refused as for deploy_project. After the update the kept data is validated against the new shapes, as validate_deployment does, and validation sums it up: {status: "ran", conforms, violation_count, result_count, examples} (at most 3 results, in validate_deployment’s shape), or {status: "unavailable", reason} when no shapes are usable or the run timed out. When the kept data no longer conforms, the update stays and the answer has a warning; fix the data or the schema, then run validate_deployment. Also returns version, triple_counts (data counts the kept data), validation_status, validation_note, compiled_from and basis. Requires deploy:write and the owner or an editor with Pro.
Tool list_deployment_tokensArgument deployment_id. Lists the deployment’s API tokens, newest first: token_id, created_at, created_by (the user id, null for older tokens) and, when set, created_via ("mcp" for tokens issued by issue_deployment_token; absent for tokens made in Agrafe), last_used_at (the last API call with it, updated at most every 5 minutes), revoked_at and label. Never returns a token value or hash. Requires mcp:read and any role on the project.
Tool issue_deployment_tokenArguments deployment_id and optionally label. Issues a new API token for the deployment, as the deployment’s API tokens panel does, marked created_via: "mcp" with the issuing user and client. How the secret reaches you is your choice on the consent screen, never the assistant’s (the tool has no argument for it): with Claim link the answer is {token_id, claim_url, expires_at} and the secret stays out of the transcript (see claiming a token); with Return to the assistant it is {token_id, token, warning}: the dlf_live_… value is then in the conversation, and in whatever the client logs, so treat it as exposed there. To change the mode, disconnect and reconnect the client. Audited as TokenCreated. Requires tokens:write and the owner: an editor is refused with rule: "role", required: "owner".
Tool revoke_deployment_tokenArguments deployment_id and token_id (from list_deployment_tokens). Revokes the token, as the API tokens panel does, and returns {token_id, revoked_at}. Revoking a token that is already revoked returns its original revoked_at. A token of another deployment, or an unknown one, answers not found. Audited as TokenRevoked. Requires tokens:write and the owner: an editor is refused with rule: "role".
Tool create_share_linkArguments deployment_id and allowed_concepts (concept names or IRIs of the deployment), optionally expires_at (RFC 3339, in the future), max_submissions (at least 1), quarantine (default false) and public_reference_concepts. Creates a form share link with the same checks as POST …/share-links: an empty allowed_concepts, a past expires_at, max_submissions: 0 or a concept the deployment does not have is a tool error, and nothing is created (concepts are not checked for Turtle-origin projects). The dls_… token is shown once, delivered as issue_deployment_token’s by your choice on the consent screen, never the assistant’s: with Claim link the answer is {link, claim_url, expires_at} (see claiming a token); with Return to the assistant it is {link, token, warning}, and the token is then in the conversation. link is the link as list_share_links shows it. Audited as ShareLinkCreated (via=mcp, the client, the link id, the delivery mode, never the token). Requires forms:share and the owner or an editor with a Pro plan (else rule: "plan").
Tool list_share_linksArgument deployment_id. The deployment’s share links, newest first, revoked ones included, with the fields of GET …/share-links. Never returns a token or its hash. Requires forms:share and the owner or an editor with a Pro plan (else rule: "plan").
Tool revoke_share_linkArguments deployment_id and link_id (a link’s id). Revokes the link and returns {link_id, revoked_at}. Idempotent: revoking a link that is already revoked returns its original revoked_at. A link of another deployment, or an unknown one, answers not found. Audited as ShareLinkRevoked, once per link. Requires forms:share and the owner or an editor with a Pro plan (else rule: "plan").
Tool write_triplesArguments deployment_id and triples ([{s, p, o}]), optionally source ({derived_from, label?, agent?}) and dry_run. Writes the triples to the deployment exactly as POST …/triples does: same body, same checks, same code (list values as JSON arrays, typed date strings, the rdfs:subClassOf rules are described there; for the value types themselves see the language reference). All or nothing: a rejected triple writes none of them, and the tool error’s structuredContent is the HTTP 422 body plus its status, {"status": 422, "errors": [{index, message}]}, one entry per rejected triple. Returns {written, graph}: written does not count the unit triples the server adds, graph is the data graph, or with a source the source graph minted for this batch. source.derived_from and source.agent must be IRIs and label at most 500 characters, else {"status": 400, "error": …}. agent defaults to your user IRI (urn:user:<your id>) when a source is given without one. At most 1000 triples per call (more is a tool error, nothing written): split larger batches. The cap is the MCP tool’s; the HTTP endpoint has none. dry_run: true writes nothing and returns the validate_triples report (same code). Audited as TriplesWritten (via=mcp, the client, the count); dry runs are not. Requires data:write and the project owner.
Tool validate_triplesArguments deployment_id and triples, optionally source, as write_triples. The dry run of write_triples (the same code as dry_run: true) under its own name, so a read-only client can use it: writes nothing and returns the report of POST …/validate/triples for the stored data plus these triples, conforms, results, skipped and warnings. A rejected triple gives the same {"status": 422, "errors": […]} as write_triples, and the same 1000-triple cap applies. Requires mcp:query; any role on the project.
Tool list_sourcesArgument deployment_id. The deployment’s source graphs, as GET …/sources: {sources: [{graph, derived_from, generated_at, agent?, label?, triples}]}, oldest first. The uuid at the end of graph is what delete_source takes. Requires mcp:read and any role on the project.
Tool delete_sourceArguments deployment_id and uuid (the last segment of a list_sources graph). Deletes that source graph, its provenance and its manifest entry, as DELETE …/sources/<uuid>, and returns {deleted, removed} (the graph IRI, the triples removed). An unknown source is {"status": 404, "error": …}, a uuid that is not one {"status": 400, …}. A mapped data file’s source (CSV, JSON, XML, …) is rebuilt by every Update, so deleting it only lasts until the next Update: the answer then has a note saying so; remove the mapping or the file to drop it for good. Audited as SourceGraphDeleted (via=mcp, the client, the graph). Requires data:write and the project owner.
Tool list_pendingArgument deployment_id. The deployment’s pending (quarantined) submissions, as GET …/pending: {pending: [{graph, derived_from, generated_at, triples, subjects, types, data, truncated?}]}, oldest first. SPARQL cannot read a pending graph, so data (the submitted triples, at most 200 per graph, truncated: true beyond) is how to review one. Requires mcp:read and any role on the project.
Tool approve_pendingArguments deployment_id and ids (uuids, the last segment of a list_pending graph). Approves them, as POST …/pending/approve: their data becomes queryable. All or nothing: one id that is not pending answers {"status": 404, "error": …} and nothing is approved; a bad uuid is a 400. At most 500 ids per call, checked before anything else. Returns {approved}. Audited as PendingApproved (via=mcp, the client, the count and the ids); an empty ids changes nothing and is not audited. Requires data:write and the project owner.
Tool reject_pendingArguments deployment_id and ids, as approve_pending. Rejects them, as POST …/pending/reject: their graphs are deleted. Same all-or-nothing rule, 500-id cap and errors as approve_pending. Returns {rejected, removed} (the graphs, the triples removed). Audited as PendingRejected. Requires data:write and the project owner.
Tool write_triples with project_idArguments project_id (instead of deployment_id: give exactly one) and triples, optionally dry_run; no source. Writes to the project’s live dev dataset (see Live view and deployments), not to a deployment. The triples get the same per-triple checks as POST …/triples, against the project’s current files (a bad triple: {status: 422, errors: [{index, message}]}), then the Live view SHACL check of the current shapes on the dataset with and without the batch: a batch that adds a Violation is refused with {status: 422, error, new_violations} and nothing is written. Violations already in the dataset, such as data a schema change made invalid, do not block a write: they show up in validate_project. Returns {written, basis}. dry_run: true writes nothing and returns the validate_project report with the batch, plus would_write and new_violations. Owner, or editor with Pro; needs Live view; scope data:write.
Tool clear_live_dataArgument project_id. Deletes the whole live dev dataset and returns {cleared} (the triples removed). Nothing else is touched: files, deployments and their data stay. Owner, or editor with Pro; needs Live view; scope data:write.
Tool copy_live_data_toArgument deployment_id, optionally dry_run. Seeds a deployment with its own project’s live dev dataset: the triples are added to the deployment’s data graph, the graph POST /api/data/<id>/triples writes (a deployment’s schema is frozen, its data is not). They are checked against the deployment’s shapes, with and without the copy: a copy that adds a Violation is refused ({status: 422, error, new_violations}), for instance when the deployment predates a property the dev data uses. A deployment made before SHACL validation answers its usual 409 (redeploy it). Returns {copied, deployment_id}; dry_run returns the deployment’s validation report with the copy, plus would_copy and new_violations. The dev dataset is kept. Owner only, like write_triples on a deployment; needs Live view; scope data:write.
Tool list_dev_tokensArgument project_id. Lists the project’s dev tokens (dlf_dev_…, for the live HTTP endpoints), newest first, with the fields list_deployment_tokens gives. Never the secret or its hash. Any role on the project; scope mcp:read; works with Live view off, so you can still see what was issued.
Tool issue_dev_tokenArgument project_id, optionally label. Issues a dev token for the project’s live view, delivered like issue_deployment_token (the secret once, or a claim link, as chosen on the consent screen). It works only on /api/projects/<project_id>/live/* of this project, never on a deployment endpoint. Owner only (an editor is refused with rule: "role"); needs Live view; scope tokens:write.
Tool revoke_dev_tokenArguments project_id and token_id (from list_dev_tokens). Revokes the token and returns {token_id, revoked_at}; revoking twice keeps the first revoked_at. A token of another project is not found. Works with Live view off. Owner only; scope tokens:write.
Tool describe_conceptArgument name, and exactly one of project_id and deployment_id (both or neither is a tool error). With project_id it compiles the project’s current files with their locked imports, as Deploy does, so it works before any deploy and answers basis: "sources"; with deployment_id it reads that deployment’s frozen schema. Returns one concept as JSON: iri, file (the package-relative path that defines it; empty in deployments made before files were recorded), variants ([{name, iri}] for a one of concept, else empty), parent and child concepts, and each property with iri (the canonical key; predicate_iri is the same value, kept for older clients), range, required (at least one value), cardinality ({min, max}, max null when unbounded, the same as bounds), cardinality_text (get_glossary’s cardinality text), constraints (the bounds as a list such as [">= 1"] or [">= 1", "<= 1"], empty when there are none), is_list (collection is "list"), and the field shape below. For a list of field, range is the element type. IRIs follow how IRIs are named; with project_id they equal a Deploy’s when the package name is an IRI (else they are relative, as in the Turtle tab). A project whose files do not load compiles to no concepts: the error then says so; see get_problems. Not available for Turtle-origin projects. With project_id, requires mcp:read and any role on the project.
Tool get_glossaryArgument project_id (from list_projects or list_deployments). Returns the project’s glossary, compiled from its current Dolfin sources: concepts, properties and rules, plus lint diagnostics. Each concept, property, datatype and individual has iri, the compiled IRI (see how IRIs are named), and qualified_name, the module-qualified name such as recipes.Recipe that draft_mapping also uses. Concepts and properties also have source_file and line. id is the bare name (Recipe), or the qualified name when two modules declare the same name. Each concept field has the field shape below, next to its older type_ref (List for a list of field) and cardinality. Each entry’s definition (and definition_i18n, per language) is the #@ glossary: definition when there is one, else the text of the leading comment, so a plain # comment above a has line shows as that field’s definition. In the compiled Turtle the two stay apart (skos:definition and rdfs:comment, see comments and labels). If the sources have errors, the tool answers with the diagnostics and whatever partial glossary could be built.
Tool draft_mappingArguments project_id, file (a CSV data file of the project, e.g. Airport.csv) and optionally concept (e.g. Airport). Reads the header and the first 5 rows, and returns a draft mapping as JSON. Given a concept, one fact whose properties are the headers matched to the concept’s property names (with as int, as float or as boolean when its type calls for one) and one variable for each header the fact reads, plus the match scores, the unmatched headers, the sample rows (only with scope files:read; without it sample_rows is left out and sample_rows_omitted says why) and concept_file, the file that defines the concept. The fact’s class is qualified by that file’s module, such as model.Airport for model.dlf, so the draft is valid in any .dlf file of the project. Properties whose type is a concept are never matched: they need an IRI, not a cell. The subject uses an id column when there is one (a header id, or one ending in ID such as Airport ID), as in <urn:airport:{?id}>, else the placeholder <urn:fixme:set-the-subject> to replace. With a concept, source is the block as Dolfin text: paste it in a .dlf file and open it in the mapping form to review it. Without a concept, the draft has one variable per header and no fact yet, and the answer lists the concepts that match the most headers. Writes nothing.
Resources docs://The docs, as Markdown (text/markdown), shipped with the server: docs://agrafe/{page} for this book (the page path without .md, e.g. docs://agrafe/mcp, docs://agrafe/output/validation), docs://dolfin/grammar for the full grammar, and docs://dolfin/syntax/{page} for the other pages of the language book, reference and tutorial alike, by file name (docs://dolfin/syntax/types, docs://dolfin/syntax/01-opening-day). Each page is whole, under a first line naming its URI and the dolfin_version it describes (also in _meta.dolfin_version). Scope mcp:read. An unknown docs:// URI answers a JSON-RPC error.
Resources file://, glossary://file://project/{project_id}/{path}: a project file’s current content as text/plain, exactly what read_file returns (a collaborator’s unsaved edits included). path is the file’s full relative path as list_files gives it, percent-encoded (file://project/P/models/my%20recipe.dlf); it is matched exactly, and an unknown path answers a JSON-RPC -32602 error. Files are not listed one by one: resources/templates/list gives the file://project/{project_id}/{path} template, to a token with files:read. glossary://project/{project_id}: the get_glossary JSON (application/json), listed in resources/list for each project you can access, to a token with glossary:read. Same permissions as the tools: files:read and project access for files, glossary:read for glossaries. A missing scope answers -32001 with the refusal in data, a project you cannot see answers not-found, and a project whose Dolfin has errors answers -32602 with the glossary report. For the Dolfin rules themselves, see the language book.
Tool get_docsThe same pages, for clients that handle resources poorly. Exactly one of topic and query, or neither. topic is a page URI, with or without docs:// (dolfin/syntax/types, agrafe/mcp): the whole page. An unknown topic is an error listing the valid ones. query searches every page for the text, ignoring case: {dolfin_version, query, total_matches, truncated, hits}, each hit {topic, uri, title, line, snippet}, at most 3 per page and 30 in all. With neither, the index {dolfin_version, topics: [{topic, uri, title}]}. Scope mcp:read.
Promptsexplore_ontology (deployment_id), write_sparql_query (deployment_id, question) and explain_concept (deployment_id, concept). Ready-made instructions that walk the assistant through the resources and tools above. Each one ends with the PREFIX declarations of the deployment’s namespaces. All their arguments are required. A fourth prompt, scaffold_app_backend, builds a new project and needs no deployment.
Video 7.2 · Claude in action, chapter “Ask your questions” (0:47–2:20). Watch on PeerTube

You can access your own projects and projects shared with you (accepted invitations), with their deployments. A deployment or project that does not exist and one you cannot access give the same error. The mcp:query tools (run_sparql_query, run_project_query, explain_fact, why_not_fact, validate_project, validate_deployment) give it as the project_not_found / deployment_not_found refusal, message unchanged (project not found or not accessible); so does write_triples with project_id.

run_sparql_query returns literals with the datatype they are stored with. An int value comes back as xsd:integer, never xsd:int, whether it was compiled from the sources or written with POST …/triples; a client that type-checks literals should expect xsd:integer.

run_sparql_query returns at most 1000 rows. When more rows match, a second message says the result was truncated; page with LIMIT and OFFSET. A query still running after 10 seconds is cancelled. validate_deployment returns at most 200 results (a second message says when more were dropped). validate_deployment and validate_project time out after 60 seconds.

Frozen deployments

A deployment is a snapshot of the project’s files taken when it was deployed or last updated. Editing the files does not change it: until someone presses Update, run_sparql_query, validate_deployment and describe_concept keep answering from the old snapshot, while get_glossary and draft_mapping read the current files. To tell them apart, every answer of get_glossary, get_deployment, describe_concept, get_namespaces, validate_deployment, deploy_project and update_deployment has a top-level basis field, and so does the SPARQL JSON result of run_sparql_query:

basisThe answer was computed from
"sources"the project’s current files (get_glossary, get_namespaces and describe_concept with project_id)
"deployment:<id>@v<n>"version n of deployment id (the other tools)
{"kind": "live", "files": [{"path", "version"}]}the project’s current files, compiled on the fly (run_sparql_query with project_id, validate_project, the project schema resource). version is the one read_file gives and write_file expects, for each file that was compiled (including files overlays).

When a deployment answer disagrees with get_glossary, call get_deployment: differs_from_sources: true and its diff_summary name the files edited since the last Update.

Live view

Live view is a project setting, off by default. Only the owner can turn it on, with the Live view switch in the header of the project’s Deployments panel, next to Deploy; no MCP tool can change it. When it is on, an assistant with mcp:query and access to the project can query and validate the project’s current files without deploying: run_sparql_query with project_id, validate_project and the schema://ontology/project/{project_id} resource. They compile the files on every change (a compiled package is reused while no file version changes) and are rate-limited like the other tools.

When it is off, these three refuse, before compiling anything, with:

{"error": "refused", "rule": "live_view_disabled", "message": "Live view is off for this project: …", "hint": "enable Live view in the project settings"}

run_sparql_query with project_id and validate_project include the project’s live dev dataset (empty unless something wrote to it), so data that a schema change makes invalid shows up in validate_project. The dev dataset tools (write_triples with project_id, clear_live_data, copy_live_data_to, issue_dev_token) and the dlf_dev_ HTTP endpoints refuse with the same error when Live view is off. Turning it off deletes nothing: the dev data and dev tokens come back when it is turned on again (list_dev_tokens and revoke_dev_token keep working meanwhile).

Tools that only read the sources, not the data, are not gated: check_dolfin, get_problems, get_namespaces, preview_turtle and describe_concept with project_id.

Field shape

describe_concept (each property) and get_glossary (each concept field) describe a field with the same keys, so the two tools agree:

KeyMeaning
collection"list" for a list of T field, whose value is one ordered rdf:List. "none" for every other field, set of T included: its values are attached directly.
element_typeThe type of each value: T for a list of T field. describe_concept names it as in range (concept name, or quantity text such as mass (quantity, quantitykind:Mass)); get_glossary as in type_ref (mass).
bounds{min, max}: how many values the field takes. max is null when unbounded. A list of field is {min: 0, max: 1} (one list; min is 1 for a key), not a count of its members. See cardinality for what each keyword means.
cardinalityget_glossary: bounds as text: exactly 1, at most 1, at least 1, 2 to 5, any. describe_concept puts that text in cardinality_text and gives cardinality as {min, max}.

Writing files

Read, then write with the version you read; on a conflict, merge the returned content and retry with its version:

{"name": "read_file",  "arguments": {"project_id": "P", "path": "models/recipe.dlf"}}
→ {"content": "concept Recipe:\n  has title: string\n", "version": "9c1e…", "size": 37}

{"name": "patch_file", "arguments": {"project_id": "P", "path": "models/recipe.dlf",
  "expected_version": "9c1e…", "dry_run": true,
  "edits": [{"old": "  has title: string\n", "new": "  has title: string\n  has servings: int\n"}]}}
→ {"dry_run": true, "version": "47ab…", "created": false,
   "diagnostics": {"entries": [], "summary": {"errors": 0, "warnings": 0}, "stale": false, "truncated": false},
   "diff": "--- a/models/recipe.dlf\n+++ b/models/recipe.dlf\n@@ -1,2 +1,3 @@\n concept Recipe:\n   has title: string\n+  has servings: int\n"}

The same call without dry_run saves it. A new file is write_file with "expected_version": null. For what a Dolfin source may contain, see the language reference.

Semantic authoring

add_concept, update_concept, remove_concept, add_field, update_field, remove_field, add_property, add_enum, add_enum_variant, remove_enum_variant, set_annotation, add_fact, update_fact, remove_fact, add_rule and add_query change a .dlf file by declaration instead of by text (the project-wide refactors work differently). They follow the same contract:

  • file is the target .dlf path. package.dlf, spreadsheets and other files are refused (write_file and patch_file edit those).
  • A missing file is an error naming create_file. With create_file: true it is created, starting empty; expected_version is then null or omitted.
  • Otherwise expected_version is required, the version read_file returned. A stale one answers a conflict, as with patch_file.
  • dry_run: true saves nothing. message shows in History, and the saved version is tagged via MCP, as for patch_file.
  • The answer is {version, created, diff, diagnostics, warnings} (plus references for remove_concept, remove_enum_variant and remove_fact, variants for the enum tools, sparql for add_query). diagnostics is the get_problems result for the file after the edit; invalid arguments are invalid_argument refusals and save nothing.
  • New declarations go after the prefix lines, comments and #@ annotations are kept, and the file keeps its line endings.
  • An edit that would add a Duplicate property, S014 or S019 error is refused (the S014w warning is not), naming the argument at fault; the check is the Problems panel’s. Other problems the edit leaves come back in diagnostics.

What the generated source means is in the language reference: concepts and fields (sub, one of:), cardinality, properties, annotations (#@ glossary:, #@ form:), @iri_name, and the grammar for list of and value constraints.

{"name": "add_concept", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
  "expected_version": "9c1e…", "dry_run": true, "name": "Ingredient",
  "fields": [{"name": "label", "type": "string", "cardinality": "one"}],
  "glossary": {"label": "Ingredient"}}}
→ {"dry_run": true, "version": "5d02…", "created": false, "warnings": [],
   "diagnostics": {"entries": [], "summary": {"errors": 0, "warnings": 0}, "stale": false, "truncated": false},
   "diff": "…\n+\n+#@ glossary:\n+#@   label \"Ingredient\"\n+concept Ingredient:\n+  has label: one string\n"}

{"name": "remove_concept", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
  "expected_version": "9c1e…", "name": "Recipe"}}
→ {"error": "invalid_argument", "argument": "on_references",
   "message": "'Recipe' is still used in 1 place(s); nothing was removed. …",
   "references": [{"file": "data.dlf", "line": 3, "col": 14, "kind": "fact", "name": "pancakes", "context": "fact pancakes a Recipe"}]}

{"name": "add_field", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
  "expected_version": "9c1e…", "concept": "Recipe", "name": "cookMinutes", "type": "int",
  "cardinality": "optional", "constraints": [">= 0"], "form": {"label": "Cuisson (minutes)", "row": 4}}}
→ {"version": "a417…", "created": false, "warnings": [], "diagnostics": {…},
   "diff": "…\n+  #@ form:\n+  #@   label \"Cuisson (minutes)\"\n+  #@   row 4\n+  has cookMinutes: optional int [ >= 0 ]\n"}

{"name": "update_field", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
  "expected_version": "a417…", "concept": "Recipe", "name": "cookMinutes", "cardinality": "one", "form": null}}

{"name": "add_property", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
  "expected_version": "b210…", "name": "basedOn", "domain": "Recipe", "range": "Recipe", "transitive": true}}
→ diff "+property basedOn: Recipe -> Recipe\n+  transitive\n"

{"name": "add_property", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
  "expected_version": "b210…", "name": "madeWith", "domain": ["Recipe", "Dish"]}}
→ {"error": "invalid_argument", "argument": "domain",
   "message": "S014: the domain of property `madeWith` conflicts with itself; nothing was saved. One domain per property: write a union as \"(A or B)\", …"}
{"name": "add_enum", "arguments": {"project_id": "P", "file": "units.dlf",
  "expected_version": "c3f8…", "concept": "Unit", "variants": ["Gram", "litre"]}}
→ {"version": "d901…", "created": false, "diagnostics": {…},
   "warnings": ["variant 'litre' is neither UPPER_CASE nor PascalCase (e.g. 'Litre')"],
   "variants": [{"name": "Gram", "iri": "http://passeplat.fr/units#Unit_Gram"},
                {"name": "litre", "iri": "http://passeplat.fr/units#Unit_litre"}],
   "diff": "…\n-concept Unit\n+concept Unit:\n+  one of:\n+    Gram\n+    litre\n"}

{"name": "remove_enum_variant", "arguments": {"project_id": "P", "file": "units.dlf",
  "expected_version": "d901…", "concept": "Unit", "variants": ["litre"], "on_references": "report"}}

{"name": "set_annotation", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
  "expected_version": "e77a…", "target": "field", "kind": "form", "concept": "Recipe", "field": "cookMinutes",
  "entries": {"row": 2, "placeholder": "30", "label": null}}}
→ diff "…\n-  #@   label \"Cuisson (minutes)\"\n-  #@   row 4\n+  #@   row 2\n+  #@   placeholder \"30\"\n"

Facts

add_fact(id, types, values?, allow_incomplete?) writes fact <id> a <types> with one line per entry of values ({field: value}, written in key order). update_fact(id, types?, values?, allow_incomplete?) replaces the type list when types is given, and replaces each field of values in place: the field’s line(s) take the new value, a field the fact does not have yet goes last, null removes one (with its # lines). Other lines, comments and their order are kept. remove_fact(id, on_references?) deletes the fact with its # / #@ lines; on_references and references are as for remove_concept (the facts, rules and queries still using it).

How a JSON value is written:

JSONWritten as
stringa string literal, escaped; or the variant itself when the field’s range is an enum that has it (a string that is not one of its variants is refused)
integer, floatan int, a float: 1.0 stays a float (negative numbers have no fact literal and are refused)
true / falsethe boolean
arrayseveral values, v1, v2 (one line per item when the items are blocks)
object of fieldsan anonymous block [ … ]; "$type": "Sub" gives its a Sub line
{"$ref": "rex"}a reference to fact rex
{"$variant": "FICTION"}an enum variant (checked against the field’s range when it is an enum)
{"$date": "2024-01-31"}date(2024-01-31 as y-m-d); other text goes in as is ("June 1st 2026")
{"$time": …}, {"$date_time": …}, {"$duration": …}, {"$quantity": "45 kg"}the smart literal with that text

A tag is a one-key object whose key starts with $, so a block (field names) is never read as one; another $ key is refused, naming values. The facts section of the language reference says what each form means.

The fact tools refuse an id another fact of the namespace already has, a type that is no concept of the project or does not resolve from the file (a bare name is a concept of the file itself; a concept of another namespace takes its qualified name, pets.Dog, and a bare Dog naming it is refused with the name to use; a type qualified by one of the file’s prefix aliases, an import’s concept, is let through with a warning and its fields are not checked), a field that the fact’s concepts (their own or inherited fields, in any file) do not have, and a result that would not parse. They also refuse an edit that leaves a fact without a required field (S010, the Problems panel’s check run before and after the edit: a fact that was already incomplete does not count). With allow_incomplete: true the edit is saved and each such S010 comes back in warnings.

{"name": "add_fact", "arguments": {"project_id": "P", "file": "data.dlf", "expected_version": "f012…",
  "id": "rex", "types": ["pets.Dog"], "values": {"name": "Rex", "species": "Dog", "weight": 4.0,
  "born": {"$date": "2024-01-31"}, "owner": {"$ref": "bob"}, "address": {"city": "Paris"}}}}
→ diff "…\n+fact rex a pets.Dog\n+  address [\n+    city \"Paris\"\n+  ]\n+  born date(2024-01-31 as y-m-d)\n+  name \"Rex\"\n+  owner bob\n+  species Dog\n+  weight 4.0\n"

{"name": "add_fact", "arguments": {"project_id": "P", "file": "data.dlf", "expected_version": "f012…",
  "id": "max", "types": ["pets.Dog"], "values": {"weight": 3.5}}}
→ {"error": "invalid_argument", "argument": "values",
   "message": "S010: missing required field `name` in fact `max` (type `pets.Dog`); nothing was saved. Give it in values, or pass allow_incomplete: true"}

{"name": "update_fact", "arguments": {"project_id": "P", "file": "data.dlf", "expected_version": "0a9b…",
  "id": "rex", "values": {"weight": 4.2, "owner": null}}}

Rules and queries

add_rule(name, source_text) and add_query(name, source_text) take the declaration as Dolfin text: source_text is one rule or query declaration named name (its # lines may come with it). It is appended after the file’s declarations, a blank line apart. Refused, saving nothing (argument: "source_text"): text that does not parse, that declares anything else (another kind, another name, a second declaration), or an edit that adds an error to the file in the Problems checker (an unknown concept, say). A name another rule (or query) of the namespace already has is refused with argument: "name".

add_query also returns sparql, the query’s generated SPARQL with its PREFIX lines, the IRIs of the live package (the one run_project_query with project_id runs), or sparql_error when the query has no SPARQL translation.

{"name": "add_query", "arguments": {"project_id": "P", "file": "pets.dlf", "expected_version": "3c1d…",
  "name": "dogs", "source_text": "query dogs:\n  ?d a Dog\n"}}
→ {"version": "…", "diff": "…\n+query dogs:\n+  ?d a Dog\n", "diagnostics": {…}, "warnings": [],
   "sparql": "PREFIX …\nSELECT …"}
{"name": "run_project_query", "arguments": {"project_id": "P", "query_name": "dogs"}}

Why a fact is not derivable

why_not_fact takes project_id, subject, predicate, object (strings, required), path (string, default "", the root) and all_fail (boolean, default false). Open the tree one node at a time: each child’s path is the argument of the next call.

{"name": "why_not_fact", "arguments": {"project_id": "P", "subject": "<http://ex/alice>",
  "predicate": "<http://ex/canVote>", "object": "true"}}
→ {"path": "", "node": {"summary": "… is not derivable from current data and rules", "tag": "goal", …},
   "children": [{"label": "stored facts for …", "expandable": true, "path": "0"},
                {"label": "rule voter", "expandable": true, "path": "1"}]}
{"name": "why_not_fact", "arguments": {…, "path": "1", "all_fail": true}}
→ {"path": "1*", "node": {"tag": "rule failed", "all_failing": true,
   "conjuncts": [{"index": 0, "text": "…", "ok": false}, {"index": 1, "text": "…", "ok": false}], …},
   "children": [{"label": "conjunct 1 …", "expandable": true, "path": "1*.0"}, …]}
{"name": "why_not_fact", "arguments": {…a fact that holds…}}
→ {"derivable": true, "hint": "use explain_fact"}

Refactors: rename_symbol and move_declaration

These two change several files at once, so they do not take file: they work on the whole project and write every file they change in one write_files call (on_conflict fail).

  • rename_symbol(kind, old_qualified, new_name) is the editor’s Rename Symbol (F2): the declaration and every reference in every .dlf file. kind is concept, enum, property, field, variant, fact or query. old_qualified is module.Name, or module.Concept.name for a field or variant, where the module is the file’s dotted path (ingredients.Ingredient). A bare Name is accepted when only one file declares it. A qualified reference keeps its qualifier (other.Ingredient becomes other.Item).
  • move_declaration(from_file, to_file, name) moves a concept, enum or property, with its # and #@ lines, to the end of to_file. to_file is created if it does not exist. References are rewritten so they still resolve: from.Name becomes to.Name everywhere, and plain Name in to_file. A bare Name left in from_file becomes to.Name. Inside the moved block, a bare reference to another declaration of from_file gets its from. qualifier, and to.X loses it. Aliases and prefixed names are left as written. How qualified names resolve is in the language reference.

Both are refused (invalid_argument, nothing saved) in these cases: an unknown or ambiguous symbol, an invalid new_name, a name the scope already has (the namespace, or the concept for a field or variant), an edit outside the project’s .dlf sources (import locks, package.dlf and Turtle files are never edited), and any error the change adds anywhere in the project (the Problems checker). Every changed file is written at the version the edit was computed on. If a file changes in between (or a version you pass in expected_versions is stale), the answer is a conflict and nothing is written. dry_run: true returns the diffs and saves nothing. message shows in History.

A .dlf file that does not parse is skipped: its references are not rewritten, so it may still use the old name. The change still goes through, but the answer lists the file in unparsed, adds a warnings entry naming it (recipes.dlf does not parse and was skipped; it may still use the old name …) and has complete: false. Fix the file and update it by hand, or run the refactor again. A stale expected_versions entry for a skipped file is still a conflict: nothing is written. A skipped file you do not list in expected_versions is not checked.

A term’s IRI is its namespace plus its name, so both tools change IRIs. The answer always carries a warnings entry saying so: data already deployed under the old IRIs may be orphaned. It also lists the project’s deployments (deployment_id, version, active; empty when there is none).

{"name": "rename_symbol", "arguments": {"project_id": "P", "kind": "concept",
  "old_qualified": "ingredients.Ingredient", "new_name": "Item", "dry_run": true}}
→ {"dry_run": true, "files": [{"path": "ingredients.dlf", "status": "written", "diff": "…"},
                              {"path": "recipes.dlf", "status": "written", "diff": "…-  has uses: ingredients.Ingredient\n+  has uses: ingredients.Item\n"}],
   "diagnostics": {…}, "warnings": ["IRIs change: … 1 deployment(s) of this project (see deployments)."],
   "deployments": [{"deployment_id": "…", "version": 3, "active": true}]}
{"name": "move_declaration", "arguments": {"project_id": "P", "from_file": "ingredients.dlf",
  "to_file": "recipes.dlf", "name": "Item"}}

Uploading data and writing mappings

upload_data_file and write_mapping follow write_file’s contract: expected_version is required (null creates), a stale one answers a conflict, dry_run: true saves nothing, and the answer is {version, created, diagnostics, diff}.

  • upload_data_file takes the content as text or as base64 (standard alphabet, padded), never both. A .csv, .json, .xml or .gpx file is stored as text, so its base64 must decode to UTF-8. A spreadsheet is binary and is stored as its base64: pass base64, not text. A file over 5 MiB, measured on the decoded bytes, is refused with argument naming text or base64. Other paths (.dlf, .md, Turtle) are refused on path: write them with write_file.

  • write_mapping reads the CSV, drafts the mapping as draft_mapping does for concept (an unknown concept gets draft_mapping’s error), and appends the block to file after a blank line, as the mapping form’s Save does. A missing file is created. Only CSV data files can be drafted.

  • overrides adjusts the draft before it is written. It takes three keys; any other key is refused on overrides:

    • subject: the fact’s subject template, such as <urn:airport:{?code}>.
    • bindings: {var: column}. It adds a variable, or points an existing one at another column.
    • matches: {property: column}. The concept’s property reads that column, with the same cast as the draft (as int, …). null drops the property.

    Variables that no template reads are dropped. A column that is not in the CSV, or a property that the concept does not have, is refused.

  • Besides write_file’s fields, the answer has source (the block written), preview, sample_rows (the first 5 data rows, as text), matches, unmatched_headers and concept_file. preview is the mapping form’s preview over the first 5 rows: {turtle, rows_total, facts_generated, diagnostics} (an {error} when the mapping cannot expand).

  • A CSV without an id-like column gets the placeholder subject <urn:fixme:set-the-subject>, so every row would become the same resource. The block is still written, with a warnings entry; fix it with overrides.subject.

For what a mapping block means, see mappings in the language reference.

{"name": "upload_data_file", "arguments": {"project_id": "P", "path": "Airport.csv",
  "text": "id,Name,elevation_ft\nBRU,Brussels,184\n", "expected_version": null}}
{"name": "write_mapping", "arguments": {"project_id": "P", "file": "airports.dlf",
  "data_file": "Airport.csv", "concept": "Airport", "expected_version": null,
  "overrides": {"subject": "<urn:airport:{?id}>"}}}
→ {"version": "5d0a…", "created": true, "diff": "…", "diagnostics": {…},
   "source": "mapping from <package://Airport.csv> as CSV\n  map: …",
   "preview": {"turtle": "…", "rows_total": 1, "facts_generated": 1, "diagnostics": []},
   "sample_rows": [["BRU", "Brussels", "184"]], "matches": […], "unmatched_headers": ["id"], "concept_file": "model.dlf"}

Renaming and deleting files: rename_file and delete_file

Both work like the file tree’s Rename and Delete. They need the files:write scope and the owner or editor role, and expected_version is required: the version that read_file or list_files returned. If the file changed since, the answer is a conflict with its current content and version, and nothing changes. Neither tool touches package.dlf or the import locks (.dolfin/imports/**).

  • rename_file(project_id, from, to, expected_version) moves from to to. to follows the same path rules as write_file and must include its extension. If to already exists, the answer is a 409 conflict and nothing is overwritten. A to whose namespace another .dlf already has (my_file.dlf while my-file.dlf exists) is refused on to. If from does not exist, the call is refused on from. A new extension must be an allowed one, and a spreadsheet can only become another spreadsheet extension. The origin .ttl keeps its extension.
  • delete_file(project_id, path, expected_version, confirm?) deletes path.

A .dlf file’s path is its namespace unless it starts with a namespace line; a file with one never changes namespace on rename. A .dlf without one keeps its namespace too: when the rename would change it, a namespace <old> line is inserted as its first code line, the answer carries kept_namespace (the old namespace) and the notice kept namespace … (delete the namespace line to follow the new path) in warnings, and no file loses its references. Its IRIs still change when its raw path differed from that namespace (a dash or a leading digit: my-file.dlf becomes namespace my_file; how paths become namespaces and IRIs is in the language reference). When IRIs change, the answer warns that data deployed under the old IRIs may be orphaned. A .dlf rename always lists the project’s deployments (deployment_id, version, active). references lists the files that still use the old namespace: the rename adds errors there, and those errors are also in diagnostics. Fix them with patch_file, for example. Both answers carry diagnostics, in the same shape as get_problems.

A data file that mapping blocks read can still be deleted, or renamed. The answer warns that the next deploy fails, and mappings lists each block (file, mapping: the block’s position in that file, counting from 1, and source). Update or remove those blocks before you deploy.

The origin .ttl, the file that a Turtle import came from, is only deleted with confirm: true. Without it, the call is refused on confirm and the message says to retry with confirm: true. Deleting it detaches the Turtle source first, so the .dlf files no longer sync with it. Only the project owner can do this. The answer has origin_detached: true.

{"name": "rename_file", "arguments": {"project_id": "P", "from": "ingredients.dlf",
  "to": "food.dlf", "expected_version": "9c1e…"}}
→ {"from": "ingredients.dlf", "path": "food.dlf", "version": "9c1e…",
   "warnings": ["IRIs change: … 1 deployment(s) of this project (see deployments).",
                "1 file(s) still reference the old namespace (see references and diagnostics): …"],
   "deployments": [{"deployment_id": "…", "version": 3, "active": true}],
   "references": ["recipes.dlf"], "diagnostics": {…}}
{"name": "delete_file", "arguments": {"project_id": "P", "path": "recipes.csv", "expected_version": "47ab…"}}
→ {"path": "recipes.csv", "deleted": true,
   "warnings": ["1 mapping(s) read package://recipes.csv (see mappings): the next deploy fails …"],
   "mappings": [{"file": "load.dlf", "mapping": 1, "source": "package://recipes.csv"}], "diagnostics": {…}}

Importing and exporting zips: import_zip and export_zip

import_zip(project_id, zip_base64, on_conflict) does what Import → Files does with a zip, and reads the zip with the same code:

  • Entries that Import skips are not imported. These are hidden files and folders, paths with .., nested zips, unsupported extensions and files that are not UTF-8 text. The answer lists each one in dropped, as {entry, reason}. Spreadsheets are imported where the server reads them, as with upload_data_file.
  • A bad file name or an oversized data file refuses the whole zip before anything is written (invalid_argument with status 400 or 413, as the Import button’s refusal).
  • on_conflict decides what happens to a path that already exists: skip keeps the project’s file (Skip conflicts) and overwrite replaces it (Overwrite all). Any other value is refused on on_conflict. package.dlf is always replaced. New files count against the owner’s file limit (rule: "limit"), checked for the whole zip first.
  • The zip’s .dolfin/imports/** locks, as Export as zip writes them, are checked against their artifact_hash before the first file is written. If one lock is incomplete, does not match its hash or repeats an import, the call is refused and nothing is imported. Once the files are written, the locks become the project’s locks and replace the others (locks: {imported, removed}). If storage fails at that last step, the files stay imported and locks.error says so. A zip without locks that brings a package.dlf re-locks its imports, as write_file does (imports_sync, package_diagnostics).

The answer reports each file, so a skipped file is never silent:

{"name": "import_zip", "arguments": {"project_id": "P", "zip_base64": "UEsDB…", "on_conflict": "skip"}}
→ {"files": [{"path": "package.dlf", "status": "overwritten", "version": "5d2a…"},
             {"path": "recipes.dlf", "status": "skipped", "version": "9c1e…"},
             {"path": "steps.dlf", "status": "written", "version": "47ab…"}],
   "dropped": [{"entry": ".git/config", "reason": "hidden file or folder"}],
   "created": 1, "updated": 1, "skipped": 1, "locks": {"imported": 1, "removed": 0},
   "diagnostics": {…}}

status is written (a new file), overwritten or skipped. version is the file’s version after the import, the one read_file gives. For a skipped file it is the version the project kept. The import is a store write, as the Import button’s: each file gets a History version, and a git-synced project autosaves.

export_zip(project_id) returns {url, expires_at}. url is <agrafe>/mcp/export/<ticket>, and a plain GET with no auth header downloads <package name>.zip. The zip holds what Export as zip downloads: every file (live edits included), a minimal package.dlf when the project has none, and the import locks under .dolfin/imports/<import>/. The link works for 10 minutes, and the ticket is random and kept in the server’s memory only (a restart forgets it). The zip is built when the link is fetched, after checking again that the user still has access and the token’s files:read scope. The link is single use: the first GET consumes it (a HEAD does not). A link that has been used or has expired, whose OAuth token has been revoked, or whose user has lost access, answers 404; call export_zip again for a new one. Anyone holding an unused link can download the zip once, so treat it like a token. Importing the downloaded zip with import_zip into another project gives the same files and locks.

Building an app backend: scaffold_app_backend

The prompt scaffold_app_backend walks the assistant from an app idea to a deployed, seeded backend. Its arguments are app_description (required: what the app does and which data it keeps) and package_iri (optional: the package IRI of a new project, e.g. https://example.org/app). It needs no deployment_id, because the deployment does not exist yet. The prompt quotes app_description as the user’s text and tells the assistant to read it as data, not as instructions.

First the assistant reads the language rules with get_docs: dolfin/syntax/syntax (cardinality and one of:), dolfin/syntax/types and dolfin/syntax/turtle (how IRIs are named). The prompt does not copy these rules; they are the pages of the language book. Then the steps are:

  1. list_projects, and create_project if no project fits.
  2. check_dolfin on the draft files, until it reports no errors.
  3. write_files (new files: expected_version: null).
  4. get_namespaces, and preview_turtle to spot-check the IRIs.
  5. The Live view checks, only if the user turns them on (see below).
  6. deploy_project with dry_run: true, then for real.
  7. issue_deployment_token. In claim-link mode the user opens the claim_url and copies the token into the app’s .env. In return mode the assistant writes the token to .env itself. Either way, the assistant never repeats the token.
  8. write_triples with dry_run: true on seed data, fixing each violation in the report.
  9. write_triples for real.
  10. validate_deployment, which must report conforms: true.
  11. Optionally, run_sparql_query on the deployment.

Live view is off by default, and only the owner can turn it on. So, before any live check (validate_project, run_sparql_query or write_triples with project_id), the assistant asks the owner to turn on the Live view switch in the header of the project’s Deployments panel, next to Deploy. A refusal with live_view_disabled carries a hint asking to enable Live view; the switch is the one above. If Live view stays off, the assistant skips the live checks and checks the data with validate_deployment after deploying.

Imports and releases

add_import, remove_import and relock_imports edit the import lines of package.dlf, then re-lock them, as the Imports rows and Save package settings do. Each line’s lock status is {import_iri, status, changed, ...}, changed meaning this call wrote or dropped the lock:

statusAlsoMeaning
lockedrelease_id (null for a web import)Resolved; your files see the import’s names.
failedreasonNot resolved, e.g. no release and the URL could not be fetched, or a public project importing a private release.
choice_neededcandidates: [{release_id, project_id, project_name, owner, version, package_iri}]Several releases match the line. Nothing is locked until you call add_import with one release_id.
removedThe lock of a line no longer in package.dlf was dropped.

list_releases lists what can be imported; create_release makes this project importable. See what releases are for.

History: list_versions, read_version, restore_version, create_checkpoint_group

These tools are the History pane’s list, preview, Restore and groups. They are not releases, which are for imports only.

Two ids are involved. An oid (from list_versions) names a History version. A version (from read_file, and what expected_version takes) is the SHA-256 of a file’s content. History merges quick saves within about 15 seconds into one version, which changes its oid, so oids are for history, versions for writes. A restore within 15 seconds of the file’s last version, changing one region only, merges into that version too, as in the History pane.

To undo its own edits, an assistant can:

  1. Call list_versions with path before editing, and note each file’s head oid.
  2. Make the edits, then group the versions they made with create_checkpoint_group (name it, for example, MCP: scaffold passe-plat).
  3. To undo, call restore_version with each file’s noted oid. There is no group restore: restore files one by one, as in the History pane.

Git sync: get_git_status, git_checkpoint, git_pause, git_resume

These tools are the Git panel’s status, Checkpoint, Pause and Resume, with the same rules (see who can do what). On a project with no repository, the three write tools answer project is not connected to a repository. When the connection keeps its token in the user’s browser, get_git_status reports token_in_browser: true (and waiting_for_browser while work waits to be pushed), and git_checkpoint is refused: MCP never holds that token. Connecting, disconnecting, importing from the repository, switching branch and resolving a divergence (overwrite the remote, take the remote version) are UI-only: no MCP tool does them.

Turtle sources: add_turtle_source and retranslate_to_dolfin

These tools are the project view’s Add Turtle source and Re-translate to Dolfin, with the same rules and the same translation: see Turtle projects. How Turtle maps to Dolfin is in the language reference.

retranslate_to_dolfin overwrites Dolfin files, so it previews by default. Run a dry run first, read the rows, then apply:

{"name": "retranslate_to_dolfin", "arguments": {"project_id": "P"}}
→ {"source": {"file_id": "T", "path": "onto.ttl", …},
   "files": [
     {"name": "org.dlf", "status": "Modified", "default_selected": true, "blocked": null,
      "lines_added": 1, "lines_removed": 0, "diff": "--- a/org.dlf\n+++ b/org.dlf\n@@ …\n+  has nick: string\n", "truncated": false},
     {"name": "other.dlf", "status": "Added", "default_selected": true, "blocked": null,
      "lines_added": 2, "lines_removed": 0, "content": "concept Thing:\n  has label: string\n", "truncated": false},
     {"name": "extra.dlf", "status": "Deleted", "default_selected": false, "blocked": null,
      "lines_added": 0, "lines_removed": 2}],
   "unchanged": ["package.dlf"]}

{"name": "retranslate_to_dolfin", "arguments": {"project_id": "P", "dry_run": false}}
→ {"added": 1, "modified": 1, "deleted": 0, "applied": ["org.dlf", "other.dlf"], "diagnostics": {…}}
  • Each changed row has a status (Added, Modified or Deleted; unchanged files are listed by name in unchanged), line counts, and, for Modified, a unified diff (current → translated), or, for Added, the new content. A text over 64 KiB is cut (truncated: true); read_file has the current text.
  • Without selected, apply writes the default_selected rows. package.dlf and Deleted rows (Dolfin files the Turtle no longer produces) are never selected by default: name them in selected to apply them.
  • A row with blocked set is a .dlf another Turtle source also generated, which this re-translate would strip of that source’s declarations. Selecting it refuses the whole call ({"error": "blocked", "file", "message"}), and nothing is written.
  • On a project with several sources, a call without file_id answers invalid_argument (argument: "file_id") with the sources to pick from. A project with no Turtle source answers {"error": "no_turtle_source"}.
  • A Turtle that does not parse answers bad_content, as in add_turtle_source.
  • Selected names that are not rows of the diff are refused (argument: "selected"). Apply is audited as Retranslated.

Scopes

ScopeKindAllows
profilereadYour email and display name.
mcp:readreadConnect, list and read resources and prompts, run list_projects, get_project, list_deployments, get_deployment, describe_concept, get_namespaces, get_docs, list_sources, list_pending, list_releases, list_versions and get_git_status; read the docs:// resources.
mcp:queryreadRun run_sparql_query, explain_fact, why_not_fact, validate_deployment, validate_project and validate_triples; read schema://ontology/project/{project_id}.
glossary:readreadRun get_glossary and draft_mapping (its sample rows also need files:read).
files:readreadRead package settings (get_package), list and read project files (list_files, read_file), problems (get_problems), check drafts (check_dolfin), preview Turtle (preview_turtle), export a zip (export_zip), read History versions (read_version).
projects:writewriteCreate projects (create_project), edit package settings (update_package), rename projects, make them public or private and move them between folders (rename_project, set_project_public, move_project_to_folder; owner only); edit imports (add_import, remove_import, relock_imports) and create releases (create_release); restore History versions and group them (restore_version, create_checkpoint_group); checkpoint, pause and resume git sync (git_checkpoint, git_pause, git_resume).
files:writewriteCreate, write and patch files (write_file, write_files, patch_file, apply_quick_fix, add_concept, update_concept, remove_concept, add_field, update_field, remove_field, add_property, add_enum, add_enum_variant, remove_enum_variant, set_annotation, upload_data_file, write_mapping); rename and delete files (rename_file, delete_file); import a zip (import_zip).
deploy:writewriteDeploy and Update (deploy_project, update_deployment).
tokens:writewriteIssue and revoke deployment tokens (issue_deployment_token, revoke_deployment_token) and dev tokens (issue_dev_token, revoke_dev_token): this client can mint API tokens.
data:writewriteWrite triples (write_triples), write and clear the live dev dataset (clear_live_data, copy_live_data_to), delete sources (delete_source), approve or reject pending data (approve_pending, reject_pending).
forms:sharewriteCreate, list and revoke form share links (create_share_link, list_share_links, revoke_share_link): this client can mint dls_ share tokens.

A client that asks for no scope gets the read scopes it is allowed, never a write scope, and is authorized without a consent page. A tool called without its scope answers access denied: missing <scope> scope.

Write access is opt-in

When a client asks for a write scope, Agrafe shows a consent page. It lists the read scopes the client gets, then one checkbox per write scope the client asked for, none of them ticked. Only the scopes you tick are granted; Cancel sends the client back with access_denied. Ticking API tokens (tokens:write), share links (forms:share) or both shows, once below the write scopes, how new tokens (API tokens and dls_ share tokens) should reach you:

Choice
Claim link (default)The assistant gets a link; you open it in Agrafe to see the token.
Return to the assistantThe token value is returned to the assistant.

The choice is stored with the authorization and kept when the client refreshes its token. To change scopes or the choice, disconnect and reconnect the client.

Claiming a token

In claim-link mode issue_deployment_token (and issue_dev_token, create_share_link) answers a claim_url (/claim/token/<id>) instead of the token. Open it signed in to Agrafe as the user who connected the assistant: the page shows which deployment and label the token is for, and Reveal token shows the dlf_live_… value once, with a Copy button. Opening the page does not use the link up (so link previews cannot burn it); revealing does. Another account sees “belongs to another account” and the link stays valid for you.

A claim link works once and for 10 minutes. The pending secret is held only in the server’s memory, so a restart of Agrafe also voids it. Either way the token itself was created: revoke it (revoke_deployment_token or the API tokens panel) and issue a new one. For a share link, revoke the link (revoke_share_link) and create a new one.

Connectors registered before a scope was offered must be reconnected to get it, as for glossary:read. Tokens issued before write scopes existed have none and keep none.

Roles

Write tools act as you, with your role in the project (see collaboration):

RoleCan
OwnerEverything.
Editor with a Pro planFiles and package settings (imports and releases included), Deploy, Update, form share links.
Editor without ProRead only (form share links need Pro too, as in Agrafe).
ViewerRead only.

Only the owner can share, rename or delete the project, make it public, issue or revoke deployment and dev tokens, and connect git. The owner’s plan limits (projects, files, active deployments, public projects) still apply. A project you cannot see answers the same not-found error as one that does not exist.

Refusals

A tool that refuses (write tools, and the mcp:query tools for bad arguments and not-found) answers a tool error (isError: true) whose text is JSON, also sent as structuredContent:

{"error": "refused", "rule": "scope", "message": "this connection lacks the files:write scope; …", "required": "files:write"}
ruleMeansrequired
scopeThe connection was not granted the scope. Reconnect and tick it.The scope.
roleYour role does not allow it."editor" or "owner".
planYou are an Editor without a Pro plan."pro".
limitThe owner’s plan limit is reached.{"limit": "files", "max": 50} (or projects, active_deployments, public_projects).
live_view_disabledThe project’s Live view is off. Carries hint instead of required.none
invalid_argumentsAn argument of an mcp:query tool is missing or malformed; message names it. Nothing was read.none
project_not_foundThe project does not exist or you cannot see it: the same answer for both.none
deployment_not_foundSame, for a deployment.none
explain_unsupportedexplain_fact / why_not_fact cannot build that proof or node.none

How writes behave

These rules apply to every write tool as it ships.

  • Versions. A file’s version is the SHA-256 (hex) of its content, so it stays the same when History merges quick saves. Every write takes expected_version: the version you last read, or null to create a file that must not exist yet. While someone edits the file live, the version is computed from what they see now.

  • Conflicts. When expected_version no longer matches, nothing is written. The tool answers a tool error, shaped like a refusal, with the current content and version, so you can merge and retry:

    {"error": "conflict", "status": 409, "message": "the file changed since you read it …", "content": "…", "version": "3f2a…"}
    

    content and version are null when the file does not exist.

  • Idempotency. Mutating tools take an optional idempotency_key. A retry with the same key, by the same user, on the same tool, within 15 minutes returns the first successful result without doing the work again, even when the other arguments differ. Failed calls are not remembered. Secrets are never kept for replay: a replayed issue_deployment_token answer has no token and lists the removed fields in redacted. write_file, write_files and patch_file take no key: their expected_version already makes a retry safe (a retry of a write that went through answers a conflict whose content is what you wrote).

  • History. A write is a normal save: collaborators editing the file see it live (an open project page picks up new files, and the Problems of files it does not have open, within a few seconds), it appears in History (merged with saves made in the next 15 seconds, like typed edits), and it triggers the git-sync autosave. Its History version is tagged via: mcp with the client name, your user and the optional message of the write. A typed edit that merges into it keeps the tag.

  • Audit log. Project create and delete, project rename, visibility change and folder move, collaborator invite and removal, package settings changes, file writes (FileWritten), Deploy, Update, token issue and revoke, source delete, pending approve and reject, and share link create and revoke are recorded in the audit log as via=mcp client=<name>, with ids only, never secrets or content.

Connecting

Claude (claude.ai)

Add a custom connector with the URL https://agrafe.dolfin.fr/mcp. Claude registers itself as a public OAuth client (no secret, PKCE), sends you to Agrafe to log in and authorize, and connects. No configuration file is needed.

Video 7.2 · Claude in action, chapter “Connect Agrafe to claude.ai” (0:04–0:48). Watch on PeerTube

Claude Desktop and other stdio clients

Settings → MCP in Agrafe shows a ready-to-copy configuration that bridges through mcp-remote:

{
  "mcpServers": {
    "agrafe": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://agrafe.dolfin.fr/mcp/sse"]
    }
  }
}

Use Copy config and paste it into claude_desktop_config.json.

Video 7.1 · Settings & AI assistants, chapter “Connect Claude and other MCP clients” (0:31–0:56). Watch on PeerTube

Endpoints

For integrators. Both transports are supported:

Endpoint
POST, GET, DELETE /mcpStreamable HTTP (protocol 2025-06-18 or 2025-03-26).
GET /mcp/sse and POST /mcp/message?session_id=…SSE transport (protocol 2024-11-05, older clients).

initialize answers with the protocol version the client asked for when it is one of 2025-06-18, 2025-03-26 or 2024-11-05. Otherwise it answers with the newest, 2025-06-18, or with 2024-11-05 if the client sent no version.

On the streamable transport, POST /mcp takes one JSON-RPC request and returns one JSON response; batches are not supported. The response to initialize carries an Mcp-Session-Id header. Send it on every later request:

CaseStatus
Header missing400
Unknown or expired session404 (start again with initialize)
Session opened by another user403
MCP-Protocol-Version header present but not a supported version400

GET /mcp with the session header opens a Server-Sent Events stream for messages from the server. Opening a new one replaces the previous stream. DELETE /mcp ends the session. A session with no open stream expires one hour after its last request.

Supported methods: initialize, ping, resources/list, resources/templates/list, resources/read, resources/subscribe, resources/unsubscribe, tools/list, tools/call, prompts/list, prompts/get. Any notifications/* message is acknowledged and ignored.

The server advertises resources.listChanged. When a project gets a new deployment, or one of its files is created, deleted or renamed (in the editor, by an import, or by an MCP write tool), every open stream of every user who can access that project (owner or accepted share) receives notifications/resources/list_changed: the GET /mcp stream on the streamable transport, the /mcp/sse stream on the SSE transport. A streamable session with no GET /mcp stream open gets no notification. A deployment never changes once created, so only the live project resource can be subscribed to (next section).

Live schema change notifications

The server also advertises resources.subscribe. Subscribe to a project’s live schema resource:

{"jsonrpc": "2.0", "id": 7, "method": "resources/subscribe",
 "params": {"uri": "schema://ontology/project/<project_id>"}}

The subscribe call is checked like resources/read of the same URI. The project’s Live view setting must be on (else the live_view_disabled error), you need scope mcp:query and access to the project. Any other URI gets -32602 (invalid params). resources/unsubscribe with the same params stops it.

Each time a file of the project is saved (editor autosave, write_file, REST update, file create, delete or rename), the session’s stream receives:

{"jsonrpc": "2.0", "method": "notifications/resources/updated",
 "params": {"uri": "schema://ontology/project/<project_id>"}}

The notification carries no content: call resources/read on the URI again to get the new Turtle. Saves less than half a second apart give one notification. Nothing is sent once Live view is switched off or you lose access to the project, and nothing is queued: a streamable session without an open GET /mcp stream can subscribe but gets no notifications. Subscriptions belong to the session and end with it.

Authorization is OAuth 2.1 with PKCE (S256):

Endpoint
/.well-known/oauth-authorization-serverServer metadata. Lists client_secret_post and none as token authentication methods.
/.well-known/oauth-protected-resource (also under a path suffix such as /mcp/sse)RFC 9728 metadata.
/oauth2/registerDynamic client registration. token_endpoint_auth_method: "none" registers a public client with no secret.
/oauth2/authorize, /oauth2/token, /oauth2/revoke, /oauth2/userinfoThe usual flow.

Rate limits

POST /mcp, DELETE /mcp and POST /mcp/message are rate-limited per access token: 100 requests per minute by default (RATE_LIMIT_RPM on the server), counted separately from the data API. Over the limit, a request gets 429 Too Many Requests; wait and retry. Opening a stream (GET /mcp or GET /mcp/sse) is not limited. There is no per-plan query quota.

An unauthenticated request gets 401 with WWW-Authenticate: Bearer resource_metadata="…/.well-known/oauth-protected-resource", which is how a client discovers where to log in.

Behind a proxy

The SSE stream needs unbuffered responses. Agrafe sends X-Accel-Buffering: no, so nginx does not stall the handshake; other proxies must not buffer /mcp/sse either. HOST=https://… splash-graph/check-mcp.sh checks discovery, OAuth registration, both transports and the buffering.