MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / build_tool

Function build_tool

bmtools/tools/shell/api.py:136–160  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

134
135
136def build_tool(config) -> Tool:
137
138 tool = Tool(
139 "Terminal",
140 "Tool to run shell commands.",
141 name_for_model="Terminal",
142 description_for_model = f"Run shell commands on this {get_platform()} machine.",
143 logo_url="https://your-app-url.com/.well-known/logo.png",
144 contact_email="hello@contact.com",
145 legal_info_url="hello@legal.com"
146 )
147
148 process: BashProcess = get_default_bash_process()
149 """Bash process to run commands."""
150
151
152 @tool.get("/shell_run")
153 def shell_run(commands: str):
154 '''Run commands and return final output.
155 Queries to shell_run must ALWAYS have this structure: {\"commands\": query}.\n",
156 and query should be a command string.
157 '''
158 return process.run(commands)
159
160 return tool

Callers

nothing calls this directly

Calls 3

get_platformFunction · 0.85
get_default_bash_processFunction · 0.85
ToolClass · 0.50

Tested by

no test coverage detected