mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 18:06:06 +00:00
feat(mcp): support mcp resources (#2215)
* feat(mcp): support mcp resources * feat(web): split MCP resources into tab * docs: add MCP resources PR review * feat(mcp): productionize resource support * feat(mcp): scope local agent tools and resources * fix(web): gate space embedding models behind login * fix(web): prevent clipped space model CTA * test: update preproc resource tool expectations * fix(web): expose skill authoring tools in selector --------- Co-authored-by: yang.xiang <yang.xiang@advancegroup.com> Co-authored-by: Hyu <chenhyu@proton.me> Co-authored-by: Junyan Qin <rockchinq@gmail.com>
This commit is contained in:
@@ -33,6 +33,24 @@ class PluginToolLoader(loader.ToolLoader):
|
||||
|
||||
return all_functions
|
||||
|
||||
async def get_tool_catalog(self, bound_plugins: list[str] | None = None) -> list[dict[str, typing.Any]]:
|
||||
catalog: list[dict[str, typing.Any]] = []
|
||||
|
||||
for tool in await self.ap.plugin_connector.list_tools(bound_plugins):
|
||||
catalog.append(
|
||||
{
|
||||
'name': tool.metadata.name,
|
||||
'description': tool.spec['llm_prompt'],
|
||||
'human_desc': tool.metadata.description.en_US,
|
||||
'parameters': tool.spec['parameters'],
|
||||
'source': 'plugin',
|
||||
'source_name': tool.owner,
|
||||
'source_id': tool.owner,
|
||||
}
|
||||
)
|
||||
|
||||
return catalog
|
||||
|
||||
async def has_tool(self, name: str) -> bool:
|
||||
"""检查工具是否存在"""
|
||||
for tool in await self.ap.plugin_connector.list_tools():
|
||||
|
||||
Reference in New Issue
Block a user