Skip to main content
Once mage-agent is connected to your IDE, your AI assistant has access to the following tools. All tools require valid authentication.
In MCP clients that support rendered tool output, mage-agent returns compact resource widgets for supported resource actions. Widgets are currently available for pipelines, blocks, pipeline runs, block runs, block outputs, pipeline schedules, and pipeline triggers. They do not change the tool arguments or authentication flow; clients that do not support rendered output still receive the normal structured tool response.

Resource Widget Contract

The widget path is an additive MCP Apps enhancement for read-only resource tools. A widget-enabled tool descriptor includes both _meta.ui.resourceUri and _meta["openai/outputTemplate"] pointing at the registered HTML resource. When the tool succeeds, mage-agent returns:
  • structuredContent.kind = "mage_resource_widget"
  • structuredContent.schema_version for renderer compatibility
  • structuredContent.resource and structuredContent.action
  • structuredContent.state as ok, empty, loading, or error
  • sanitized records, summary, columns, filters, and pagination
  • optional sanitized mutation metadata for create, update, or delete results
  • optional sanitized graph data for pipeline-oriented detail widgets, using normalized nodes and edges instead of raw pipeline YAML
  • content[0].text as a JSON fallback for clients that do not render widgets
  • _meta["openai/widgetData"] with widget-only rendering hints
List and get widgets render the normal table or detail view. Mutating actions may render the returned record with a mutation summary banner and footer, such as Operation: Create; delete results without a returned record render a compact success state. The adapter must redact sensitive fields before they enter structuredContent, fallback content, widget _meta, or activity logs. Pipeline-oriented widgets may include a compact graph preview when Mage returns block dependency metadata. The graph shape is:
Renderers should treat graph data as optional. If it is missing, malformed, or too large, the widget must fall back to the existing list/detail table without blocking the tool response.

Adding Widget Support

To add another Mage resource widget:
  1. Add the resource/action pair to widget_contracts.py.
  2. Add presentation columns, summary fields, empty/error copy, and guidance in widget_registry.py.
  3. Add adapter tests that cover populated, empty, malformed, large-result, and secret-bearing payloads.
  4. Add renderer coverage in widgets/resource_widget and the app-shell preview route under /apps/test/resource-widgets.
  5. Run the MCP protocol tests and an EKS mocked app-shell visual check before calling the change QA-ready.
For normal Mage trigger inventory, active trigger counts, API/webhook trigger lists, run-once schedules, and next run dates, use pipeline_schedules. Use pipeline_triggers only when the user explicitly asks for the advanced PipelineTriggerResource config surface scoped to a pipeline.

Codex chat context

Read the visible non-chat text that Mage Pro AI Chat captured from the user’s current browser page for the active chat turn.This tool is only registered when Mage Pro AI Chat starts Codex with captured page context. Standard IDE MCP sessions do not expose it unless MAGE_AGENT_CURRENT_PAGE_CONTEXT_PATH points to a valid context sidecar file.
The context is scoped to the authenticated user and chat session, excludes the Codex chat UI, and should only be used for page-relative requests such as “explain this page” or “what am I looking at?”

Pipelines

List all pipelines in the project.Arguments: noneExample prompt: “List all my Mage pipelines”
Get details for a single pipeline.
Create a new pipeline.Example prompt: “Create a new streaming pipeline called realtime_events
Update fields on an existing pipeline.
Delete a pipeline by UUID.
Deletion is permanent and cannot be undone.

Blocks

List all blocks in a pipeline.
Get block details including source code.
Create a new block in a pipeline.Supported block types: data_loader, transformer, data_exporter, sensor, callback, chart, conditional, custom, dbt, extension, global_data_product, markdown, scratchpad
If no config is provided, mage-agent automatically matches a block template for you. For integration pipelines, it also auto-detects available sources and destinations.
Example prompt: “Add a SQL transformer block to the customer_etl pipeline that filters rows where revenue > 1000”
Update a block’s code or configuration.
List available block templates.Templates are cached for 24 hours at ~/.mage-agent/cache/block_templates.json.

Runs & Logs

Trigger a pipeline run.Example prompt: “Run the daily_refresh pipeline”
Fetch logs for a specific pipeline run.Example prompt: “Show me the logs for the last run”

Sync

Pull all remote project files to a local directory.
Show what has changed between local and remote.
Push locally changed files to the cluster.

Mage Cloud Backend

Mage Cloud Backend tools are exposed only for installed-agent sessions that have Cloud handoff credentials. These tools are generated from the Cloud Backend resource inventory, so call mage_tool_contract before invoking a Cloud tool when payload or query shape matters.
Cloud Backend create and update requests use the same resource-root envelope that the backend API expects. Do not send flat mutation payloads.Role fields use Cloud Backend integer values: owner 0, admin 1, editor 2, viewer 3.For example, creating a team invitation uses:
cluster_stats requires query.cluster_uuid; cluster_uuid is not a path identifier for that tool.cloud_users supports list, get, and update. It does not expose create, because Cloud Backend treats users.create as the public signup path rather than a private team-admin user creation API.

Error responses

All tool errors return a structured envelope: