Skip to main content
Glama

OpenFactory

write_internal_repository

Commit files into an attached internal repository over MCP.

This is the write path for a caller with no shell on this host. Commits land on the repository's work branch and NEVER on main: main is what OBS builds and what an ISO installs, and it only moves when you call publish_internal_repository. Each call adds ONE commit on top of the current work tip and amends no earlier commit. That commit overwrites each path in files and removes each path in delete, so send only the files that change.

base_revision is how you reconcile with a main that moved: pass 'main' to restart work from the published tip, discarding work commits that were never published, and re-apply these files on top of it. Pass a SHA to make the write conditional on work still being where you last saw it.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "files": "<files>",
      "message": "<message>"
    },
    "name": "write_internal_repository"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesAttached repository id, name, or unambiguous label returned by list_internal_repositories.
filesYesFiles to write, as [{path, content}] or [{path, content_b64, mode}]. Paths are repository-relative. Binaries and file modes are supported.
deleteNoRepository-relative paths to remove in the same commit.
messageYesCommit message.
base_revisionNoOmit to commit on top of the current work tip. Pass 'main' to restart work from the published main and re-apply these files. Pass a commit SHA to require the work tip to be exactly that.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden and does so: it discloses the target branch (work, never main), that each call produces exactly one commit with no amend, that files are overwritten and delete paths removed in the same commit, and that base_revision='main' discards unpublished work commits. These are exactly the destructive/irreversible traits an agent must know before writing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

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

Front-loaded with the core action and the branch-model constraint before the parameter physics. Dense and mostly waste-free, though the backtick-heavy formatting and the second paragraph's overlap with the base_revision schema description cost a little economy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter mutation tool with no annotations but a full schema and an output schema, the description covers the branch lifecycle, commit granularity, overwrite/delete semantics, and base_revision reconciliation. Nothing an agent needs to avoid a harmful write is missing, and return values are covered by the output schema.

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

Parameters4/5

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

Schema coverage is 100%, so baseline would be 3, but the description adds real meaning beyond the schema: it explains what base_revision='main' actually does (restart work from the published tip, discard unpublished commits, re-apply files) and what SHA-conditional behavior guarantees. Only the 'name' lookup and file-mode details are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a concrete verb and resource ('Commit files into an attached internal repository') and immediately distinguishes the write path from the publish path. The reader knows exactly what the tool mutates and which sibling owns the other half of the workflow.

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

Usage Guidelines5/5

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

Explicitly frames this as the write path for callers with no shell on the host, and states that main only moves when publish_internal_repository is called, which routes the agent to the correct sibling at the right moment. It also warns to send only changed files, giving a clear when-not-to-send-everything rule.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.