kifas.workflow.optimize
kifas.workflow.optimize
Section titled “kifas.workflow.optimize”Statically optimize a successful run; if there are safe wins, validate them by re-running in the background (paid compute — requires confirm_rerun). Returns immediately.
Required scopes: workflow:write
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workflow_id |
string |
yes | — | |
run_id |
string |
yes | — | |
confirm_rerun |
boolean |
yes | — |
Returns
Section titled “Returns”{ "type": "object", "properties": { "status": { "type": "string", "enum": [ "no_safe_wins", "optimization_started" ] }, "estimated_ms_saved": { "type": "number" }, "validated": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "status", "estimated_ms_saved", "validated", "message" ], "additionalProperties": false}Code samples
Section titled “Code samples”TypeScript (Anthropic MCP SDK)
import { Client } from '@modelcontextprotocol/sdk/client/index.js'import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamable-http.js'
const transport = new StreamableHTTPClientTransport( new URL('https://mcp.kifas.io/'), { requestInit: { headers: { Authorization: `Bearer ${process.env.KIFAS_API_KEY}` }, }, },)const client = new Client({ name: 'demo', version: '0.1.0' })await client.connect(transport)
const result = await client.callTool({ name: 'kifas.workflow.optimize', arguments: { "workflow_id": "00000000-0000-0000-0000-000000000000", "run_id": "00000000-0000-0000-0000-000000000000", "confirm_rerun": false },})console.log(result)Python (httpx, raw JSON-RPC)
import osimport httpx
resp = httpx.post( "https://mcp.kifas.io/", headers={ "Authorization": f"Bearer {os.environ['KIFAS_API_KEY']}", "Content-Type": "application/json", }, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.workflow.optimize", "arguments": { "workflow_id": "00000000-0000-0000-0000-000000000000", "run_id": "00000000-0000-0000-0000-000000000000", "confirm_rerun": false }, }, },)print(resp.json())curl
curl https://mcp.kifas.io/ \ -H "Authorization: Bearer $KIFAS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.workflow.optimize", "arguments": { "workflow_id": "00000000-0000-0000-0000-000000000000", "run_id": "00000000-0000-0000-0000-000000000000", "confirm_rerun": false } }}'Raw JSON-RPC body
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.workflow.optimize", "arguments": { "workflow_id": "00000000-0000-0000-0000-000000000000", "run_id": "00000000-0000-0000-0000-000000000000", "confirm_rerun": false } }}Try it
Section titled “Try it”Want to try kifas.workflow.optimize? Sign in to the dashboard and run it against a real session.