Python SDK for EO Toolbelt built-in tools, MCP tools, and provider-native tool schemas
Project description
EO Toolbelt SDK
Korean documentation: README.ko.md
EO Toolbelt SDK helps Python applications expose utility tools, custom Python functions, and MCP server tools to model providers.
It gives you three small building blocks:
- list available tool specs
- execute a selected tool by name
- build provider-native tool option payloads for OpenAI, Anthropic, Gemini, and Bedrock Converse
The SDK does not call a language model for you. Your application keeps the model message loop and passes tool results back using the provider's normal API format.
Install
pip install eo-toolbelt
Import package:
from mcp_tools_sdk import Tools
Quick Start
import asyncio
from mcp_tools_sdk import Tools
async def main() -> None:
tools = Tools()
result = await tools.call_tool(
"safe_calculate",
{"expression": "(12 + 8) * 3"},
)
print(result)
asyncio.run(main())
Build Model Tool Options
from openai import AsyncOpenAI
from mcp_tools_sdk import Tools
client = AsyncOpenAI()
tools = Tools()
tool_options = await tools.model_tool_options(
provider="openai",
tool_names=["safe_calculate", "get_current_datetime"],
)
response = await client.responses.create(
model="gpt-5",
input="What is 12 * 8, and what time is it in Seoul?",
**tool_options,
)
If the model returns a tool call, parse the provider response, call tools.call_tool(...), then send the tool result back to the model.
Tools Constructor
tools = Tools(
config_path="mcp_servers.json",
timeout_seconds=30,
custom_tools=[my_custom_tool],
)
| Option | Type | Description |
|---|---|---|
config_path |
`str | Path |
timeout_seconds |
`float | None` |
custom_tools |
iterable | Python callables or CustomTool objects registered on this instance. |
backend |
internal backend | Alternate runtime backend for tests and advanced embedding. |
Main Methods
list_tools(...)
Returns canonical tool specs.
catalog = await tools.list_tools(
include_internal=True,
include_mcp=True,
include_custom=True,
mcp_server_names=["fetch"],
selected_tool_names=["safe_calculate"],
)
call_tool(tool_name, arguments=None)
Executes one built-in, custom, or MCP tool.
result = await tools.call_tool(
"safe_calculate",
{"expression": "7 * 6"},
)
MCP tools use this name format:
mcp__{server_name}__{tool_name}
model_tool_options(provider, ...)
Converts tool specs into provider-native request fields.
tool_options = await tools.model_tool_options(
provider="bedrock",
tool_names=["safe_calculate"],
tool_choice={"auto": {}},
)
| Provider value | Returned fields |
|---|---|
openai, gpt, openai_responses |
OpenAI Responses API tools and optional tool_choice. |
openai_chat_completions |
OpenAI Chat Completions tools and optional tool_choice. |
anthropic, claude |
Anthropic Messages tools and optional tool_choice. |
gemini |
Gemini tools with function_declarations and optional tool_config. |
bedrock, bedrock_converse |
Bedrock Converse toolConfig. |
select_tools(query, ...)
Selects a compact tool list from a catalog. Pass an LLM callback for model-judged selection, or omit llm for the deterministic keyword fallback.
tool_names = await tools.select_tools(
query="Calculate actual vs budget variance by department.",
max_tools=4,
llm=select_with_llm,
)
Custom Tools
from typing import Literal
from mcp_tools_sdk import Tools, custom_tool
def apply_discount(amount: float, rate: float = 0.1) -> dict:
"""Apply a discount rate."""
return {"amount": amount, "rate": rate, "total": amount * (1 - rate)}
@custom_tool(name="classify_priority")
def classify_priority(level: Literal["low", "high"]) -> str:
"""Classify a priority level."""
return level.upper()
tools = Tools(custom_tools=[apply_discount, classify_priority])
MCP Config
Pass an MCP config file when your application wants to expose MCP server tools:
tools = Tools(config_path="mcp_servers.json")
An example config is available at examples/mcp_servers.example.json.
Environment variable placeholders use this form:
${ENV_NAME}
${ENV_NAME:-default}
Credential values can also be attached to a Tools instance:
tools.configure_integration(
"github",
{"access_token": "github_pat_..."},
)
Detailed Guides
The PyPI project description links to the repository documentation for the full service guide and tool catalog:
| Document | Purpose |
|---|---|
| SDK usage guide | Detailed SDK options, provider values, selection modes, and examples. |
| Tool catalog | Built-in tools, configured MCP servers, and common MCP tool ids. |
| Korean tool catalog | Korean tool catalog for built-in and MCP tools. |
License
Distributed under the Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eo_toolbelt-0.1.2.tar.gz.
File metadata
- Download URL: eo_toolbelt-0.1.2.tar.gz
- Upload date:
- Size: 55.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9903f6bc23eb4e9ba2e1699d891002a519546deaba7b935699e06b2996c6f3b1
|
|
| MD5 |
ddd1829b9075837a4d1ebf54550d4ac4
|
|
| BLAKE2b-256 |
c7ad6ecf01f8d81bf46f411f5abbae6c273b9caa93b420bbf4130081796e278d
|
File details
Details for the file eo_toolbelt-0.1.2-py3-none-any.whl.
File metadata
- Download URL: eo_toolbelt-0.1.2-py3-none-any.whl
- Upload date:
- Size: 49.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e31f62dadc8a6a6b1e1fb22bd3c8a9b7d7acff95966b7aebafbf6a0b5bbedeaa
|
|
| MD5 |
825f5230785bc61008a554f0cae056b9
|
|
| BLAKE2b-256 |
28f4cd4db73fb7f160ea6974f2399c6edf4a4c2f393db0921a13a5510f65253e
|