Skip to main content

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 eo_toolbelt import Tools

Quick Start

import asyncio

from eo_toolbelt 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 eo_toolbelt 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 eo_toolbelt 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.
SDK dependency guide Fact-focused guide for including EO Toolbelt as a service dependency.
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eo_toolbelt-0.1.3.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eo_toolbelt-0.1.3-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file eo_toolbelt-0.1.3.tar.gz.

File metadata

  • Download URL: eo_toolbelt-0.1.3.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for eo_toolbelt-0.1.3.tar.gz
Algorithm Hash digest
SHA256 afa2eb5251343532eb667d6bc10a41d693a576a7ddbc6e8a0f2d8a60d49acb4d
MD5 4b1ca969e52b3adabd51b6a9cd22850b
BLAKE2b-256 4f10bf6920185b814588fb1573596b0c930c220ef913f36a9a159c0e63d95a2f

See more details on using hashes here.

File details

Details for the file eo_toolbelt-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: eo_toolbelt-0.1.3-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

Hashes for eo_toolbelt-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b4566c00f7ecd0a3f4cc5af5a2e2812cfdf5bcdebdcfc2ca8a9df76d2f92058e
MD5 75f66f47a76b06bfbe8b1b50feba66a1
BLAKE2b-256 fe59a7ef17eccc55d646879f4d444c6ffd8b1e3ba8358ca4a2d61af8c7474561

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page