Use MCPApp name when adding tools from module (#664)
This commit is contained in:
parent
de742ff4f1
commit
995a516d5e
4 changed files with 11 additions and 5 deletions
|
|
@ -255,11 +255,17 @@ class ToolCatalog(BaseModel):
|
|||
output_model=output_model,
|
||||
)
|
||||
|
||||
def add_module(self, module: ModuleType) -> None:
|
||||
def add_module(self, module: ModuleType, name: str | None = None) -> None:
|
||||
"""
|
||||
Add all the tools in a module to the catalog.
|
||||
|
||||
Args:
|
||||
module: The module to add.
|
||||
name: Optionally override the name of the toolkit with this parameter
|
||||
"""
|
||||
toolkit = Toolkit.from_module(module)
|
||||
if name:
|
||||
toolkit.name = name
|
||||
self.add_toolkit(toolkit)
|
||||
|
||||
def add_toolkit(self, toolkit: Toolkit) -> None:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "arcade-core"
|
||||
version = "3.2.0"
|
||||
version = "3.3.0"
|
||||
description = "Arcade Core - Core library for Arcade platform"
|
||||
readme = "README.md"
|
||||
license = {text = "MIT"}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ class MCPApp:
|
|||
|
||||
def add_tools_from_module(self, module: ModuleType) -> None:
|
||||
"""Add all the tools in a module to the catalog."""
|
||||
self._catalog.add_module(module)
|
||||
self._catalog.add_module(module, self._toolkit_name)
|
||||
|
||||
def tool(
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||
|
||||
[project]
|
||||
name = "arcade-mcp-server"
|
||||
version = "1.6.0"
|
||||
version = "1.6.1"
|
||||
description = "Model Context Protocol (MCP) server framework for Arcade.dev"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "Arcade.dev" }]
|
||||
|
|
@ -21,7 +21,7 @@ classifiers = [
|
|||
]
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"arcade-core>=3.2.0,<4.0.0",
|
||||
"arcade-core>=3.3.0,<4.0.0",
|
||||
"arcade-serve>=3.0.0,<4.0.0",
|
||||
"arcade-tdk>=3.0.0,<4.0.0",
|
||||
"arcadepy>=1.5.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue