Skip to main content
A plugin can reverse invoke other tool-type plugins within the Dify platform. If you are unfamiliar with the basics of reverse invocation, first read Reverse Invocation of Dify Services. Consider the following scenarios:
  • A tool-type plugin implements a function, but the result is not as expected and the data needs post-processing.
  • A task requires a web scraper, and you want the flexibility to choose the scraping service.
  • You need to aggregate results from multiple tools, which is difficult to handle in a Workflow application.
In these cases, your plugin needs to call other existing tools: tools from the marketplace, a self-built Workflow as a Tool, or a custom tool. All of them are available through the plugin’s self.session.tool field.

Call Installed Tools

Call any tool installed in the current Workspace, including other tool-type plugins.

Entry Point

    self.session.tool

Interface

    def invoke_builtin_tool(
        self, provider: str, tool_name: str, parameters: dict[str, Any]
    ) -> Generator[ToolInvokeMessage, None, None]:
        pass
  • provider: The plugin ID plus the tool provider name, formatted like langgenius/google/google.
  • tool_name: The specific tool name.
  • parameters: The arguments passed to the tool.

Call Workflow as Tool

See the Tool Plugin documentation for more information on Workflow as Tool.

Entry Point

    self.session.tool

Interface

    def invoke_workflow_tool(
        self, provider: str, tool_name: str, parameters: dict[str, Any]
    ) -> Generator[ToolInvokeMessage, None, None]:
        pass
  • provider: The ID of this tool.
  • tool_name: The name specified when the tool was created.

Call Custom Tool

Entry Point

    self.session.tool

Interface

    def invoke_api_tool(
        self, provider: str, tool_name: str, parameters: dict[str, Any]
    ) -> Generator[ToolInvokeMessage, None, None]:
        pass
  • provider: The ID of this tool.
  • tool_name: The operation_id from the OpenAPI specification. If no operation_id exists, this is the tool_name automatically generated by Dify, which you can find on the tool management page.

Edit this page | Report an issue