Framework adapters
On this page you’ll install cortrix-skills, call its tools directly, and turn them into tool definitions that Claude, OpenAI, or LangChain understand.
cortrix-skills provides a CortrixToolKit with 29 methods that map one-to-one to the MCP server’s regular tools, with the same names and semantics. Three adapters turn the toolkit into each framework’s native tool format, so you don’t write tool glue by hand. Admin tools are out of scope for this package.
Prerequisites
- A running Cortrix service. See the Quickstart.
- Python 3.9 or later, in a virtual environment.
Install
Install the package from PyPI. It brings in the Python SDK as a dependency:
The framework SDKs are optional dependencies. Building Claude or OpenAI tool definitions needs no framework SDK at all, because the definitions are plain JSON. Install a framework’s package when you need it, for example pip install anthropic.
Call the tools directly
CortrixToolKit is lazy: it makes no network request until you call a method.
| Parameter | Default | Description |
|---|---|---|
base_url | — | Required unless you pass client |
api_key | None | A Cortrix API key |
default_namespace | "default" | Used when a method doesn’t name a namespace |
client | — | Pass in an existing cortrix.Cortrix client |
Connect a framework
The three examples below come from cortrix-skills/README.md in the repository. They need a key for the matching LLM service, and the full round trip with a model hasn’t been tested for this page.
Claude Tools
OpenAI function calling
LangChain
Error handling
Cortrix errors pass through unchanged from the Python SDK. This package adds no error codes of its own. Every error carries code, retryable, category, retry_after_ms, and structured_data, and each adapter surfaces them in its framework’s native shape:
| Framework | How an error appears |
|---|---|
| LangChain | A ToolException whose message is these fields as JSON |
| Claude Tools | A tool_result with is_error=True whose content is these fields as JSON |
| OpenAI | These fields as JSON, returned as the tool message content |
An agent can use them to decide for itself whether to retry, wait, or report, without parsing free text.
Next steps
- MCP server: the full list of tools.
- Python SDK