Use MCP
Operate Monkeys from local agents or external automation through MCP and product APIs
This guide describes how a local agent or external automation can operate Monkeys through product APIs and MCP-style tool access. It complements the Product Data Assembly Guide.
The external operation model is simple:
- Discover the product context.
- Read before writing.
- Use stable data, workflow, and tool contracts.
- Trigger actions through product entrypoints.
- Persist and inspect results.
- Keep important actions traceable.
MCP is an operation entrypoint, not a shortcut around the product model. External agents should still respect ontology, views, permissions, workflow contracts, tool contracts, and artifact handling.
Operation Model
Before You Start
Confirm the agent has:
- A reachable Monkeys product endpoint.
- An MCP server or equivalent product-operation adapter.
- Authentication configured for the target product environment.
- A known workspace or team context when the operation requires one.
- Permission to read the data, execute workflows, upload files, or update records.
- A way to inspect tool schemas and API contracts.
Recommended first checks:
- Show the active connection context.
- List accessible workspaces or teams.
- List available workflows.
- Query a small data view sample.
- Inspect API docs or tool schema before using a generic API call.
Operating Principles
Read Before Write
External agents should inspect current product state before making changes.
Read:
- Available workspaces or teams.
- Relevant data repositories and views.
- Workflow definitions and required inputs.
- Existing execution history.
- API or tool schema.
- Existing records or artifacts that may be updated.
Then write only with explicit identifiers and scoped payloads.
Prefer Dedicated Tools
Use a dedicated MCP tool or product API when one exists.
Use generic API calls only when:
- No dedicated tool exists.
- The endpoint schema has been inspected.
- The request body is small, explicit, and reversible or easy to review.
- The agent can explain why the generic call is needed.
Keep Data Contracts Stable
Do not invent new record structures in prompts. Use ontology, schema, view, workflow, and tool contracts.
When the agent needs to write data, it should know:
- The target object.
- The target record or repository.
- Required fields.
- Allowed enum values.
- Artifact attachment rules.
- Permission and validation requirements.
Make Actions Traceable
For important operations, preserve:
- Who or what initiated the action.
- The target object.
- Input data.
- Workflow or tool version when available.
- Execution result.
- Created or updated artifacts.
- Error message and retry status when failed.
Current Operation Capabilities
Available capabilities may vary by deployment and MCP server version. The common operation categories are:
| Category | Typical capability |
|---|---|
| Connection | Show active connection context and authentication state. |
| Workspace/team discovery | List accessible workspaces or teams and pick an execution context. |
| Workflow discovery | List workflows, search by name, inspect workflow detail. |
| Workflow management | Create, update, or delete workflow definitions when allowed. |
| Workflow execution | Execute a workflow with structured input data. |
| Execution inspection | Get one execution status or search execution history. |
| Data view query | Query a data view preview or sample records. |
| Tag and filter discovery | Inspect tag groups and tags for data filtering. |
| API discovery | List available API docs and inspect endpoint schema. |
| Generic API call | Call product APIs when no dedicated tool exists. |
| File operation | Upload or download files as artifacts. |
Common MCP Tool Patterns
The exact tool list may evolve, but the following names represent common current patterns:
| Task | Typical tool |
|---|---|
| Inspect connection | mcp_connection_info |
| List workspaces or teams | mcp_list_teams |
| List workflows | mcp_list_workflows |
| Get workflow detail | mcp_get_workflow_detail |
| Create workflow | mcp_create_workflow |
| Update workflow | mcp_update_workflow |
| Delete workflow | mcp_delete_workflow |
| Execute workflow | mcp_execute_workflow |
| Get execution result | mcp_get_execution |
| Search executions | mcp_search_executions |
| Query data view | data-query-view-preview |
| Random sample data view | data-query-view-random-sample |
| List tag group tags | data-list-bucket-tag-group-tags |
| List API docs | mcp_get_api_docs |
| Inspect endpoint | mcp_get_api_endpoint |
| Generic API call | mcp_call_api |
| Upload file | mcp_upload_file |
| Download file | mcp_download_file |
Use the tool descriptions returned by the MCP client as the source of truth when the deployed server differs from this guide.
Connection And Context
Step 1: Confirm Connection
Ask the agent to show the current connection context.
Expected result:
- Endpoint or host is correct.
- Authentication is active.
- The agent can explain which product environment it is operating.
If connection fails:
- Check MCP server URL.
- Check authentication configuration.
- Check network access.
- Check whether the product API endpoint is reachable.
Step 2: Select Workspace Or Team Context
Many operations require a workspace or team identifier.
The agent should:
- List available contexts.
- Pick the intended one by name or identifier.
- Reuse that identifier consistently in workflow, data, and file operations.
Do not guess identifiers from stale logs or screenshots if a discovery tool is available.
Data Operations
Query A Data View
Use data view query when the agent needs to inspect product data.
Recommended flow:
- Identify the workspace or team context.
- Identify the data repository or object.
- Resolve the view by id or name.
- Apply tag, field, search, or semantic filters when needed.
- Request a small preview first.
- Increase limit only after confirming the result shape.
The result should include:
- Selected repository or object.
- Selected view when available.
- Returned records.
- Count or pagination metadata.
- Warnings when view or tag resolution used a fallback.
Sample Data
Use sampling when the task needs representative records, especially for image-heavy or tag-heavy datasets.
Good uses:
- Pick reference images for generation.
- Review data quality.
- Inspect tag distribution.
- Create a small test input for workflow execution.
Avoid:
- Treating a random sample as a complete dataset.
- Writing updates based only on a sample unless the user asked for sampling.
- Ignoring warnings about unresolved tags or fallback views.
Update Data Through API
When no dedicated data-write MCP tool exists, use API discovery before a generic API call.
Flow:
- List API docs.
- Inspect the endpoint schema.
- Confirm method, path, query, and body.
- Read the target record first.
- Send the smallest valid update.
- Read back the updated record or view.
If the operation is destructive or broad, ask for explicit human confirmation before proceeding.
Workflow Operations
Find A Workflow
Flow:
- List workflows with search.
- Pick workflow by stable identifier, not only display name.
- Get workflow detail.
- Inspect variables, required inputs, tasks, and outputs.
- Build input data from product records or explicit user input.
Execute A Workflow
Before execution:
- Confirm workflow identifier and version if relevant.
- Confirm input data matches workflow variables.
- Confirm selected records are the intended inputs.
- Confirm output expectations.
Execute:
- Call the workflow execution tool with structured input.
- Capture the returned execution identifier.
- Poll execution status or query it later.
After execution:
- Inspect terminal status.
- Inspect output payload.
- Locate generated artifacts.
- Confirm whether outputs were persisted into records or repositories.
- Record follow-up actions if needed.
Update A Workflow
Workflow updates are product configuration changes. Treat them carefully.
Before updating:
- Read the current workflow detail.
- Preserve required version or locking fields.
- Identify exactly which fields, variables, tasks, or outputs change.
- Avoid broad rewrites when a small update is enough.
- Confirm that downstream applications still understand the output.
After updating:
- Read back workflow detail.
- Run a small test execution if safe.
- Check execution history or logs.
File And Artifact Operations
Upload A File
Flow:
- Confirm the target workspace or team context.
- Confirm intended purpose: source input, workflow input, generated result, or documentation artifact.
- Upload the file.
- Capture file identifier, URL, MIME type, size, and metadata.
- Link the artifact to a record, workflow, or output when relevant.
Avoid orphan files. If a file carries product meaning, it should be connected to product data.
Download A File
Flow:
- Resolve the file or artifact identifier.
- Download the file or base64 payload.
- Preserve metadata.
- Use it only for the requested operation.
Do not treat downloaded artifacts as authoritative if a newer record or workflow result exists.
Generic API Calls
Generic API calls are useful but sharp. Use them as a fallback.
Before calling a generic endpoint, confirm:
- Dedicated MCP tool does not cover the task.
- API docs have been inspected.
- The method and path are correct.
- Required query and body fields are present.
- The body does not contain unrelated fields.
- The operation is not destructive or broad without review.
Recommended pattern:
{
"method": "GET",
"path": "/api/example",
"query": {
"limit": 10
}
}For write calls, keep the body small and read back the result.
Cookbook
Cookbook: Inspect A Data View
- Show connection context.
- List workspaces or teams.
- Query the data view by view name or id.
- Ask for a small limit first.
- Summarize returned records and warnings.
- If needed, query again with stricter filters.
Cookbook: Trigger A Workflow From Selected Records
- Query the source view.
- Select records by explicit identifiers.
- List workflows and find the intended workflow.
- Get workflow detail and inspect required input.
- Build input data using selected records.
- Execute workflow.
- Poll execution.
- Inspect output and artifacts.
- Confirm whether output was persisted.
Cookbook: Create Or Update A Workflow
- List existing workflows to avoid duplicates.
- Get similar workflow detail if available.
- Build a minimal definition.
- Create or update with explicit fields.
- Read back the saved workflow.
- Run a small test execution if safe.
- Document assumptions and output contract.
Cookbook: Upload A File As An Artifact
- Confirm target context.
- Upload file.
- Capture metadata.
- Link it to the intended record or workflow input.
- Query the related view or record to confirm visibility.
Cookbook: Troubleshoot A Failed Execution
- Get execution by identifier.
- Check terminal status and error message.
- Search execution history for related runs.
- Inspect workflow detail.
- Compare input data against workflow variables.
- Check whether required artifacts or records were missing.
- Retry only after the likely cause is addressed.
Error Handling
| Symptom | Likely cause | What to do |
|---|---|---|
| Connection failed | MCP URL, product endpoint, or network issue | Check endpoint, server process, and network access. |
| Authentication failed | Missing or invalid credential | Reconfigure authentication and retry connection check. |
| Workspace or team not found | Wrong context or insufficient access | List available contexts and select an accessible one. |
| Workflow not found | Wrong identifier or display name mismatch | List workflows and inspect detail by stable identifier. |
| Input validation failed | Workflow input does not match schema | Read workflow detail and rebuild input data. |
| View not found | Wrong view name or repository context | List views or query by identifier. |
| Tag not resolved | Tag name mismatch or ambiguous semantic query | Inspect tag groups and use explicit tag identifiers. |
| Execution timed out | Long-running workflow or worker issue | Query execution later; inspect execution history. |
| File not visible | Uploaded but not linked as artifact | Link file metadata to the intended record or output. |
| Generic API failed | Wrong method, path, query, or body | Inspect endpoint schema before retrying. |
Safety Checklist
Before a local agent changes product state, confirm:
- The target workspace or team is correct.
- The target record, workflow, view, or file is identified by stable id.
- The operation has been read first when possible.
- The request body is minimal and scoped.
- The operation follows product data contracts.
- The action can be audited or explained.
- Destructive or broad changes have explicit human approval.
- The agent will read back the result after the write.
Agent Prompt Template
Use this template when asking a local agent to operate Monkeys:
Goal:
<what should change or be inspected>
Context:
- Product endpoint:
- Workspace/team:
- Data repository or view:
- Workflow:
- Relevant records or files:
Rules:
- Read before writing.
- Prefer dedicated MCP tools.
- Use stable identifiers.
- Keep writes minimal.
- Preserve artifacts and action history.
- Report warnings and exact output identifiers.
Expected output:
- Summary of actions
- Records/workflows/files touched
- Execution ids or artifact ids
- Any unresolved risksCompletion Criteria
An external operation is complete when:
- The agent can explain what it read.
- The agent can identify exactly what it changed or triggered.
- Workflow executions have terminal or follow-up status.
- Artifacts are linked when they carry product meaning.
- Results are visible through product data or execution APIs.
- Errors and skipped steps are reported clearly.