> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agents.labs.bandwidth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an agent

> MCP reference for get_workflow.

Tool: `get_workflow`. Requires **Viewer or higher** in the applicable workspace and a connected [OAuth session](https://docs.agents.labs.bandwidth.com/mcp/authentication.md).

Returns the agent’s authoring `code` and metadata. `lifecycle_status` describes the agent; `version_status` describes its selected definition. Use the full returned code for subsequent edits. An agent without a versioned definition returns `version_not_found`; create a version in the console before editing through MCP.

## Arguments

| Name | Type | Required | Defaults and limits |
| - | - | - | - |
| `workflow_id` | integer | Yes | See full schema |

## Example arguments

Replace sample resource IDs with IDs returned in your selected workspace.

```json theme={null}
{
  "workflow_id": 42
}
```

## Result and errors

The schema below describes MCP `structuredContent`, including the `result` wrapper where present. Your client may also display a text representation. Read success flags and structured errors before continuing; transport success alone does not prove the operation succeeded. Authentication, missing membership, and insufficient role can fail before a tool result is produced. See [troubleshooting](https://docs.agents.labs.bandwidth.com/mcp/troubleshooting.md).

**Effect:** Reads data. **Retry:** Declared idempotent. Discovery annotations describe behavior; they do not grant permission or replace confirmation for consequential actions.

> [accordion] Input schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "workflow_id": {
>       "type": "integer"
>     }
>   },
>   "required": [
>     "workflow_id"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Result schema
>
> ```json theme={null}
> {
>   "properties": {
>     "assistant_mode": {
>       "enum": [
>         "single_prompt",
>         "workflow"
>       ],
>       "type": "string"
>     },
>     "code": {
>       "type": "string"
>     },
>     "id": {
>       "type": "integer"
>     },
>     "lifecycle_status": {
>       "enum": [
>         "draft",
>         "active",
>         "paused",
>         "archived"
>       ],
>       "type": "string"
>     },
>     "name": {
>       "type": "string"
>     },
>     "version_number": {
>       "type": "integer"
>     },
>     "version_status": {
>       "enum": [
>         "draft",
>         "published"
>       ],
>       "type": "string"
>     }
>   },
>   "required": [
>     "id",
>     "name",
>     "lifecycle_status",
>     "version_status",
>     "version_number",
>     "code",
>     "assistant_mode"
>   ],
>   "type": "object"
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.