MCP

The NLX MCP Interface exposes your AI app's capabilities as standard Model Context Protocol tools. This allows external Agents, LLMs, and MCP-compliant clients to discover and execute actions defined within your NLX deployment.

When to use this API

  • Agent Integration: Allow autonomous agents (like AutoGen or LangChain agents) to use your NLX app as a toolkit.

  • Tool Discovery: Dynamically query what your AI app can do (e.g., "CheckInventory", "ResetPassword") and retrieve the schema for those actions.

Configuration

Setting

Value

Base URL

https://apps.nlx.ai/c/mcp/{deploymentKey}/{channelKey}-{languageCode}

Header

nlx-api-key: YOUR_API_KEY

Important: As with other endpoints, append the language code (e.g., -en-US) to the channel key.

1. List Available Tools (GET)

Retrieve a list of all tools exposed by this deployment, including their names, descriptions, and JSON schemas for arguments.

Endpoint: GET /tools

curl -X GET "https://apps.nlx.ai/c/mcp/xxxx/xxxx-en-US/tools" \
  -H "nlx-api-key: YOUR_API_KEY"

Response Example:

{
  "tools": [
    {
      "name": "check_order_status",
      "description": "Retrieves the status of a customer order",
      "inputSchema": {
        "type": "object",
        "properties": {
          "orderId": { "type": "string" }
        },
        "required": ["orderId"]
      }
    }
  ]
}

2. Execute a Tool (POST)

Invoke a specific tool by name. You pass the arguments defined in the tool's schema.

Endpoint: POST /tools/{toolName}

Standard Execution (JSON)

Useful for single, synchronous results.

Response Example:

Streaming Execution (SSE)

If a tool produces long-running output or you want real-time feedback, enable streaming.

Response: Returns text/event-stream chunks prefixed with data:.

Last updated