Skip to main content
Glama

Ferrite

Check a crate against the code gate

code_gate
Read-onlyIdempotent

Check source policy before submission (no #![forbid(unsafe_code)] at the crate root = CODE_UNSAFE_PERMITTED; a dependency besides ferrite-app). Fix violations before continuing. Admission is not compilation or a test verdict. For existing-app repairs, commit changed files and deploy the exact returned reference; see rcs_commit. Cargo.toml: [package] name="" version="0.1.0" edition="2021" [dependencies] ferrite-app={path="../ferrite-app"} API for handle() in deploy_source's loop. Request: req.method, req.path (may end ?query), req.body (Vec; a form post is urlencoded), req.idempotency_key, req.headers (only those the route lists, e.g. add "forward_headers":["cookie"] to the spec's route to read a cookie). Reply: let mut r=IngressReply::to(req,200,html.into_bytes()); r.headers.push(("content-type".into(),"text/html; charset=utf-8".into())); a form POST answers 303 with ("location","/"); at most one ("set-cookie",...) per reply. Store db, each call async -> io::Result: get(&[u8])->Option<Vec>; put(&[u8],&[u8]); add(&[u8],i64)->(new,version), an atomic counter get reads as decimal text; scan_prefix(prefix,None,500)->(Vec<(key,value,version)>,more); put_if_version(k,v,None).await?.is_ok() creates k only if absent. std and ferrite_app only (ferrite_app::serde_json), escape visitor text in HTML. #[test]s go in src/main.rs under #[cfg(test)]; deploy_source does not run them (see test_ref). Returns {admitted, violations:[{code,detail}], test_admitted, test_violations, tests_scanned}. packages adds Ferrite source packages under src//.

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": {
      "files": "<files>"
    },
    "name": "code_gate"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesmap of relative path -> file content, e.g. {"Cargo.toml": "...", "src/lib.rs": "..."}
packagesNoFerrite source packages to compile in, by name from list_packages ("name" or "name@version"). The server adds each package's files, and its dependencies', under src/<root>/ before anything reads `files`; declare each root in src/lib.rs (read_package gives the lines). Do not send those files yourself: a changed copy is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real substance on top: the two violation classes, the fact that admission implies neither compilation nor passing tests, and the returned fields ({admitted, violations:[{code,detail}], test_admitted, test_violations, tests_scanned}). The long block about deploy_source's `handle()` and the store API describes the target environment, not this tool's own behavior, so it does not earn full credit.

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

Conciseness2/5

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

The text is a single unstructured block that jumps from policy rules to a Cargo.toml snippet to request/reply and key-value store API details to return values, with no headings or ordering. Several paragraphs are arguably irrelevant to invoking code_gate, and the genuinely important constraints (violation codes, return shape) are buried mid-stream rather than front-loaded.

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

Completeness3/5

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

There is no output schema, and the description does supply the return keys and the violation taxonomy, which covers the essentials for a two-parameter check tool. However, it never explains what test_admitted/test_violations are derived from or what happens beyond 'fix violations' on failure, leaving gaps that the surrounding API-doc padding does not fill.

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

Parameters3/5

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

Schema description coverage is 100%, so both `files` and `packages` are already documented in the schema. The description's note that '`packages` adds Ferrite source packages under src/<root>/' restates the schema rather than adding new semantics, so the 3 baseline applies.

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

Purpose4/5

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

The opening clause states a specific verb and resource ('Check source policy before submission') and gives concrete policy rules (no `#![forbid(unsafe_code)]` at the crate root, a dependency besides ferrite-app), so an agent knows this is a static policy gate on submitted files. The remaining ~80% of the text drifts into Cargo.toml templates and `handle()` request/reply API, which dilutes rather than sharpens the stated purpose.

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

Usage Guidelines4/5

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

Explicitly says to check 'before submission' and to 'Fix violations before continuing', and it draws a boundary against alternatives by noting 'Admission is not compilation or a test verdict' and pointing at test_ref for tests and rcs_commit for committing changed files. It does not spell out when to skip this tool (e.g. what deploy_source itself enforces), so the routing picture is clear but not exhaustive.

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.