Skip to main content
Glama

Ferrite

Deploy an app from source

deploy_source
Destructive

FIRST deploy and fork redeploy: ONE build (4-8 min), not rcs_commit+test_ref+deploy_ref (two). First run code_gate on the files (1 s; it lists Cargo.toml and the API). Then build_status {build_id, wait_s: 50}; never resubmit. Same app and service names again = update, data kept. spec (string; set name, artifact_key apps/@v1). For a small store, hot_set_gib 0 uses the default cache; 1 requests 1 GiB per store copy. Call estimate_cost with this spec and the planned instance count first: {"services":[{"name":"requests","primitive":"queue","workload":{"read_qps":50,"write_qps":50,"record_size_kb":1,"keying":"PerKey","hot_set_gib":1}},{"name":"data","primitive":"store","workload":{"read_qps":50,"write_qps":50,"record_size_kb":1,"keying":"PerKey","hot_set_gib":0}}],"applications":[{"name":"vote","artifact_key":"apps/vote@v1","artifact_sha256":"0000000000000000000000000000000000000000000000000000000000000000","bindings":[{"handle":"requests","kind":"queue","service":"requests"},{"handle":"data","kind":"store","service":"data"}],"routes":[{"prefix":"/","binding":"requests","kind":"api"}],"compute":{"memory_mb":256,"cpu_percent":50}}]} src/main.rs (keep the loop, write handle()): #![forbid(unsafe_code)] use ferrite_app::client::StoreClusterClient; use ferrite_app::{app_main,rt,serde_json,AppContext,FerriteApp,IngressReply,IngressRequest}; struct App; impl FerriteApp for App{fn run(ctx:AppContext)->impl std::future::Future<Output=std::io::Result<()>>+Send{serve(ctx)}} async fn serve(ctx:AppContext)->std::io::Result<()>{ let mut q=ctx.queue("requests")?;let mut db=ctx.store("data")?; loop{ let l=match q.poll_wait(1_000).await{Ok(Some(x))=>x,Ok(None)=>continue, Err(_)=>{rt::time::sleep(std::time::Duration::from_millis(200)).await;continue}}; let Ok(req)=serde_json::from_slice::(&l.payload) else{let =q.ack(l.token).await;continue}; let rep=match handle(&mut db,&req).await{Ok(r)=>r,Err()=>IngressReply::to(&req,503,b"retry".to_vec())}; if let Ok(mut o)=ctx.reply_to_queue(&req.reply_to).await{if let Ok(p)=serde_json::to_vec(&rep){let _=o.publish(&p).await;}} let _=q.ack(l.token).await;}} async fn handle(db:&mut StoreClusterClient,req:&IngressRequest)->std::io::Result{/yours/} fn main(){app_main::()}

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

Input Schema

NameRequiredDescriptionDefault
specYesthe InfraSpec JSON
filesYes
tokenNofallback bearer for clients that cannot send an Authorization header; when a header is present omit this argument, because a different token is refused
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.
instancesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare destructive=true, idempotent=false and openWorld=true, but the description adds substantial unprompted context: build duration, that reusing the same app and service names performs an update with data kept, that resubmitting is harmful, that packages are unpacked server-side and hand-supplied copies are refused, and the Authorization-header/token precedence rule. These are exactly the operational facts an agent cannot derive from the annotations or schema.

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?

Roughly 250 words of telegraphic prose plus a full ~30-line Rust program are packed into the description, burying the critical workflow ordering and update semantics in dense run-on clauses. The example is relevant but belongs in docs; the prose fragment style ('FIRST deploy and fork redeploy: ONE build ... not rcs_commit+test_ref+deploy_ref (two)') costs readability without saving meaning.

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

Completeness4/5

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

For a destructive, five-parameter, no-output-schema tool this covers the essential ground: what gets built, how long, what re-deploying does, prerequisite cost estimation and the follow-up build_status call. The main gap is instances, which is only referenced obliquely, and there is no statement of what the call returns besides an implied build_id.

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?

For spec, which is only described as 'the InfraSpec JSON' in the schema, the description supplies a concrete worked example covering name, artifact_key, services, primitive/workload, hot_set_gib semantics and application bindings/routes/compute. The files parameter is clarified by the required src/main.rs skeleton with the 'keep the loop, write handle()' instruction. Only instances is left essentially unexplained beyond its name.

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 sentence names the operation and its scope ('FIRST deploy and fork redeploy'), and explicitly contrasts it with the rcs_commit+test_ref+deploy_ref path, which lets an agent tell it apart from deploy_ref. The telegraphic phrasing ('ONE build (4-8 min), not ...') makes the first read harder than it needs to be, but the resource and verb are unambiguous.

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?

It gives explicit ordering (run code_gate on the files, then this, then build_status with wait_s: 50), an explicit prohibition ('never resubmit'), and an explicit prerequisite ('Call estimate_cost with this spec and the planned instance count first'). It also names the alternative path for cases this tool doesn't cover, so the agent knows both when to use it and when not to.

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.