API Reference
Myelin exposes three MCP tools. All are called through the standard MCP tool-calling interface.
search
Search for matching workflows. Call this to find relevant procedures before starting a task.
Parameters
{
"task_description": "string (required) — natural language description of the task.
Keep procedural detail (steps, output format); omit variable values
(file paths, names, IDs) that change between uses."
}Response
Returns matching workflows with overview and step summaries:
Reset a user's password via the admin panel.
Steps:
1) Look up user by email
2) Trigger password reset
3) Confirm reset email sentIf no workflows match, returns an empty result.
record
Begin a recording session for a task. Call this at the beginning of any task you want Myelin to learn from.
Parameters
{
"task_description": "string (optional) — natural language description of the task",
"workflow_id": "string (optional) — workflow ID from search results, if a match was found"
// At least one of task_description or workflow_id is required.
}Response
session_id: ses_abc123
Recording started. When done, call finish(session_id).Behavior
- If a
workflow_idis provided, the session is linked to that workflow. The agent should follow the procedure returned by search. - If no
workflow_idis provided, the agent works freestyle. The session still records tool calls for potential workflow extraction.
finish
Finalize a recording session and queue it for server-side evaluation. Call this after the task is complete.
Parameters
{
"session_id": "string (required) — the session_id from record"
}Response
{
"session_id": "ses_abc123",
"tool_calls_recorded": 5,
"status": "queued",
"workflow_id": "wf_xyz789" // present if a workflow was matched
}Behavior
The server evaluates the session independently using an LLM judge that reviews the recorded tool calls and produces categorical verdicts:
- With workflow — The evaluator judges task completion (success / partial / failure) and workflow adherence (followed / partial / diverged). The workflow's success rate is updated.
- Without workflow — The evaluator judges task completion only. If the verdict is success, a new workflow is extracted from the session trace and queued for approval in the dashboard.
Error Codes
401 Unauthorized — invalid or missing API key
400 Bad Request — missing required parameter
404 Not Found — session_id does not exist or is not active
429 Rate Limited — too many requests
500 Internal Server Error