MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / execute

Method execute

plugin/bundles/calculator/plugins/evaluate/plugin.py:6–15  ·  view source on GitHub ↗
(self, credentials: BundleCredentials, plugin_input: PluginInput)

Source from the content-addressed store, hash-verified

4
5class Evaluate(PluginHandler):
6 async def execute(self, credentials: BundleCredentials, plugin_input: PluginInput) -> PluginOutput:
7 expression: str = plugin_input.input_params.get("expression")
8 try:
9 expression = sp.sympify(expression)
10 result = expression.evalf()
11 return PluginOutput(data={"result": str(result)})
12 except Exception as e:
13 raise_http_error(
14 ErrorCode.REQUEST_VALIDATION_ERROR, "Invalid expression. Please provide a valid expression."
15 )

Callers

nothing calls this directly

Calls 3

PluginOutputClass · 0.85
raise_http_errorFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected