Skip to main content

Overview

The Tools API allows plugins to invoke other tools (built-in or custom). Permission Required: tool_invocation

Methods

invoke

Invoke a tool by UUID or name.
def invoke(
    tool_uuid: str | None = None,
    tool_name: str | None = None,
    parameters: dict[str, Any] | None = None
) -> dict[str, Any]

Parameters

ParameterTypeDescription
tool_uuidstr | NoneTool UUID (for custom tools)
tool_namestr | NoneTool name (for built-in tools)
parametersdict | NoneTool parameters
Note: Must provide either tool_uuid or tool_name.

Returns

dict[str, Any] - Tool execution result

Raises

  • PluginPermissionError - If permission not granted
  • ToolInvocationError - If invocation fails

Usage Examples

Invoke Built-in Tool

from nadoo_plugin import NadooPlugin, tool

class MyPlugin(NadooPlugin):
    @tool(name="search_web")
    def search_web(self, query: str) -> dict:
        result = self.api.tools.invoke(
            tool_name="web_search",
            parameters={"query": query}
        )

        return result

Invoke Custom Tool

def on_initialize(self):
    # Get tool UUID from config
    self.custom_tool_uuid = self.config.get("custom_tool_uuid")

@tool(name="use_custom")
def use_custom(self, input_data: str) -> dict:
    result = self.api.tools.invoke(
        tool_uuid=self.custom_tool_uuid,
        parameters={"input": input_data}
    )

    return result

Chain Tools

@tool(name="process_pipeline")
def process_pipeline(self, data: str) -> dict:
    # Step 1: Preprocess
    preprocessed = self.api.tools.invoke(
        tool_name="preprocessor",
        parameters={"data": data}
    )

    # Step 2: Analyze
    analyzed = self.api.tools.invoke(
        tool_name="analyzer",
        parameters=preprocessed
    )

    # Step 3: Summarize
    summary = self.api.tools.invoke(
        tool_name="summarizer",
        parameters=analyzed
    )

    return summary

See Also