Skip to main content
The Sari MCP Server exposes three tools for API discovery and execution.

search_api_collections

Search for API collections using natural language semantic search.

Parameters

ParameterTypeRequiredDescription
query_key_wordstringYesNatural language search query
client_idstringYesYour client identifier
api_keystringYesYour API secret

Response

Returns a formatted string with matching collections and similarity scores.

Example

Input:
{
  "query_key_word": "payment processing credit card",
  "client_id": "client_a1b2c3d4",
  "api_key": "your-api-key"
}
Output:
Found 3 matching API collections:

1. Stripe Payment API (similarity: 0.89)
   Payment processing and subscription management

2. PayPal Checkout API (similarity: 0.82)
   Online payment processing

3. Square Payments API (similarity: 0.75)
   Point of sale and online payments

Notes

  • Results are filtered to collections you have access to
  • Similarity scores range from 0 to 1 (higher is better)
  • Maximum 10 results returned by default

get_openapi_spec

Retrieve the OpenAPI specification for a collection.

Parameters

ParameterTypeRequiredDescription
collection_namestringYesName of the collection (from search results)
client_idstringYesYour client identifier
api_keystringYesYour API secret

Response

Returns the OpenAPI specification as a JSON string.

Example

Input:
{
  "collection_name": "Stripe Payment API",
  "client_id": "client_a1b2c3d4",
  "api_key": "your-api-key"
}
Output:
{
  "openapi": "3.0.0",
  "info": {
    "title": "Stripe Payment API",
    "version": "1.0.0"
  },
  "servers": [
    {"url": "https://api.stripe.com"}
  ],
  "paths": {
    "/v1/charges": {
      "post": {
        "summary": "Create a charge",
        "parameters": [...],
        "requestBody": {...}
      }
    }
  }
}

Notes

  • Collection name matching is case-insensitive
  • The full OpenAPI spec is returned, including all endpoints
  • Use this to understand available operations before executing

execute_api

Execute an API request against a registered collection.

Parameters

ParameterTypeRequiredDescription
collection_namestringYesTarget collection name
methodstringYesHTTP method (GET, POST, PUT, DELETE, PATCH)
endpointstringYesAPI endpoint path
headersstringNoJSON string of additional headers
query_paramsstringNoJSON string of query parameters
path_paramsstringNoJSON string of path parameters
request_datastringNoJSON string of request body
client_idstringYesYour client identifier
api_keystringYesYour API secret

Response

Returns the API response as a JSON string.

Example

Input:
{
  "collection_name": "Stripe Payment API",
  "method": "POST",
  "endpoint": "/v1/charges",
  "headers": "{\"Idempotency-Key\": \"unique-key-123\"}",
  "request_data": "{\"amount\": 1000, \"currency\": \"usd\", \"source\": \"tok_visa\"}",
  "client_id": "client_a1b2c3d4",
  "api_key": "your-api-key"
}
Output:
{
  "id": "ch_1234567890",
  "object": "charge",
  "amount": 1000,
  "currency": "usd",
  "status": "succeeded"
}

Path Parameters

For endpoints with path parameters like /users/{id}:
{
  "endpoint": "/users/{id}",
  "path_params": "{\"id\": \"user_123\"}"
}
The {id} placeholder will be replaced with user_123.

Error Responses

All tools return errors in a consistent format:
{
  "error": "Error message",
  "details": "Additional information"
}

Common Errors

ErrorCauseSolution
Collection not foundInvalid collection nameUse search to find correct name
Access deniedNo permission for collectionRequest access from admin
Invalid requestMalformed parametersCheck JSON formatting

Best Practices

Always use search_api_collections first to find the correct collection name and verify you have access.
Use get_openapi_spec to understand available endpoints, required parameters, and expected responses before executing.
Always check for error responses before proceeding with subsequent calls.
For POST requests that create resources, include an idempotency key in headers to prevent duplicates.