API Query Tool
Internal REST API query tool for chat agents providing discovery, monitoring, and troubleshooting capabilities.
Overview
The api_query tool enables chat agents to query the Data Machine REST API (via rest_do_request) for discovery and monitoring. It supports single requests and batch requests.
Parameters
Single request
- endpoint (string, required): REST API endpoint path (e.g.,
/datamachine/v1/tools) - method (string, optional): HTTP method (defaults to
GET) - data (object, optional): Request body data for
POST,PUT, orPATCH
Batch requests
- requests (array): Array of requests:
{ endpoint, method, data?, key? }. Ifkeyis omitted, a key is derived from the endpoint path.
Available Endpoints
Discovery
- Handlers, step types, and handler details were retired from
datamachine/v1(#3456); query the ability runner routes instead (see below) GET /datamachine/v1/auth/{handler}/status– Check OAuth connection statusGET /datamachine/v1/providers– List AI providers and modelsGET /datamachine/v1/tools– List available AI tools
Pipelines (Read-Only)
Pipelines routes were retired (#3456); query the ability runner routes instead:
GET /wp-abilities/v1/abilities/datamachine/get-pipelines/run?input={"pipeline_id":123}– Get pipeline details with steps and flowsPOST /wp-abilities/v1/abilities/datamachine/get-pipelines/runwith{"input": {}}– List all pipelines
Flows (Read-Only)
Flow routes were retired (#3456); query the ability runner routes instead:
GET /wp-abilities/v1/abilities/datamachine/get-flows/run?input={"flow_id":123}– Get flow detailsPOST /wp-abilities/v1/abilities/datamachine/get-flows/runwith{"input": {"pipeline_id": 123}}– List flows for a pipelinePOST /wp-abilities/v1/abilities/datamachine/get-problem-flows/runwith{"input": {}}– List flows flagged for review due to consecutive failures/no items
Jobs & Monitoring
Jobs routes were retired (#3456); query the ability runner routes instead:
POST /wp-abilities/v1/abilities/datamachine/get-jobs/runwith{"input": {}}– List all jobsPOST /wp-abilities/v1/abilities/datamachine/get-jobs/runwith{"input": {"flow_id": 123}}– Jobs for specific flowPOST /wp-abilities/v1/abilities/datamachine/get-jobs/runwith{"input": {"status": "failed"}}– Filter by statusPOST /wp-abilities/v1/abilities/datamachine/get-jobs/runwith{"input": {"job_id": 456}}– Job details
Logs
Log routes were retired (#3456); query the ability runner routes instead:
POST /wp-abilities/v1/abilities/datamachine/read-logs/runwith{"input": {"job_id": 456}}– Logs for specific jobPOST /wp-abilities/v1/abilities/datamachine/get-log-metadata/runwith{"input": {}}– Log counts and time range
System
Settings routes were retired (#3456); query the ability runner routes instead:
POST /wp-abilities/v1/abilities/datamachine/get-settings/runwith{"input": {}}– Get plugin settingsPOST /wp-abilities/v1/abilities/datamachine/get-step-types/runwith{"input": {}}– List step typesPOST /wp-abilities/v1/abilities/datamachine/get-handlers/runwith{"input": {}}– List handlers
Files
GET /datamachine/v1/fileslisting andDELETE /datamachine/v1/files/{filename}were retired (#3456) — use thedatamachine/list-flow-filesanddatamachine/delete-flow-fileability run routes (flow_step_idrequired)POST /datamachine/v1/files– Upload file (multipart, retained)
Usage Examples
List All Handlers
{
"endpoint": "/wp-abilities/v1/abilities/datamachine/get-handlers/run",
"method": "POST",
"body": { "input": {} }
}Check OAuth Status
{
"endpoint": "/datamachine/v1/auth/twitter/status",
"method": "GET"
}Get Pipeline Details
{
"endpoint": "/wp-abilities/v1/abilities/datamachine/get-pipelines/run",
"method": "POST",
"body": { "input": { "pipeline_id": 123 } }
}Monitor Job Status
{
"endpoint": "/wp-abilities/v1/abilities/datamachine/get-jobs/run",
"method": "POST",
"body": { "input": { "job_id": 456 } }
}Response Format
Single request response
{
"success": true,
"data": { /* response body */ },
"status": 200,
"tool_name": "api_query"
}Batch request response
{
"success": true,
"batch": true,
"data": {
"handlers": { /* ... */ },
"pipelines": { /* ... */ }
},
"errors": {
"jobs": "Missing endpoint"
},
"partial": true,
"request_count": 3,
"success_count": 2,
"error_count": 1,
"tool_name": "api_query"
}Error Handling
Returns structured error responses for:
- Invalid endpoints or methods
- Authentication/authorization failures
- Malformed request data
- Server-side processing errors
Integration
This tool complements specialized workflow tools by providing comprehensive API access for:
- System monitoring and diagnostics
- Configuration verification
- Troubleshooting workflow issues
- Administrative operations
Use specialized Focused Tools like create_pipeline, delete_flow, add_pipeline_step, and configure_flow_step for mutation operations. api_query is strictly read-only for discovery and monitoring.