https://linen.dev logo
Incorrect API reference schema for COMPOSIO_EXECUT...
# 🖥│support-forum
h
Hi team, I've discovered that calling the Composio Execute Tool is resulting in an error when using the provided reference API schema. It appears the endpoint is stripping the request down to just the arguments body, so it can't find the required fields. This is the schema that's currently working: { "connectedAccountId": "account_id", "arguments": { "tool_slug": "GMAIL_SEND_EMAIL", "arguments": { "body": "example_body", "subject": "example_subject", "recipient_email": "example_email" } } } However, when using the referenced API schema, the endpoint receives only this payload, which fails: { "body": "example_body", "subject": "example_subject", "recipient_email": "example_email" } The failed request log ID is: log_G7_ZzO-gbOTu
h
Unfortunately, it is not possible, because when you are calling the Composio tool, you have to provide the slug in the API URL (COMPOSIO_EXECUTE_TOOL). But you have to provide additional tool slug for the actual tool to execute. In that case, only adjusted schema above works. But executing a specific tool directly, like GMAIL_SEND_EMAIL works just fine.
u
Hi @hjertefolger, Yes, when you are using
COMPOSIO_EXECUTE_TOOL
, additional param
tool_slug
is to be passed. You can use this CUrl as a reference:
Copy code
curl -X POST 'https://backend.composio.dev/api/v3/tools/execute/COMPOSIO_EXECUTE_TOOL' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '{
    "arguments": {
      "allow_destructive": false,
      "arguments": {},
      "tool_slug": "GMAIL_FETCH_EMAILS"
    }
  }'
h
@Uday Don't get me wrong, it is working perfectly - it is fast, easy to work with, excellent work guys! Just wanted to let you know, that it is not obvious from the schema.
c
Awesome! you can get the complete schema of the specific tool using [https://docs.composio.dev/api-reference/tools/get-tools-by-tool-slug](https://docs.composio.dev/api-reference/tools/get-tools-by-tool-slug?explorer=true). This should help you understand the fields, body and params for each Tool.