Skip to Content
The Makinari API repo now includes an MCP Server — connect your AI models directly. View on GitHub →
MCP ServerToolsReportPOST

Report

Query data from the database. Use action=“list” to get up to 50 records. Use action=“count” to get the total matching a filter.

IMPORTANT - column reference (the schema is also returned in every response as table_schema): • leads: id, created_at, name, email, phone, … • conversations: id, created_at, status, channel, … … (schema summary)

Tables WITHOUT a direct site_id (scoped automatically via join - do NOT filter by site_id on these): • messages - scoped via conversations.site_id • agent_memories - scoped via agents.site_id

Rules:

  • Never add a site_id filter - it is applied automatically.
  • Use “count” first to know the total before paginating.
  • Increment offset by limit to get the next page. Stop when has_more=false.
  • If you get a column error, check table_schema in the response and retry with correct column names.

Input Schema

ParameterTypeDescription
actionstring”list” returns rows. “count” returns only the total. Enum: list, count
tablestringTable to query. Enum: leads, conversations, messages, tasks, campaigns, segments, content, requirements, agents, commands, visitors, agent_memories, sites
columnsarrayColumns to return. Omit to return all. Use only column names from table_schema.
filtersarrayFilter conditions. Do NOT include site_id - it is automatic.
order_bystringColumn to sort by. Default: created_at.
order_dirstringDefault: desc. Enum: asc, desc
limitnumberMax rows (1–50). Default: 50.
offsetnumberPagination offset. Start at 0.

REST Endpoint

POST /api/agents/tools/report/query

Send a JSON body with the same parameters as the MCP input schema. The site_id and user_id fields are required when calling via REST.

POST /api/agents/tools/report/query Authorization: Bearer YOUR_API_KEY Content-Type: application/json { "action": "list", "table": "leads", "site_id": "YOUR_SITE_ID", "user_id": "YOUR_USER_ID", "filters": [{ "column": "status", "operator": "eq", "value": "new" }], "limit": 20, "offset": 0 }

Response:

{ "success": true, "rows": [...], "total": 42, "has_more": true }
Last updated on