---
title: Tool
---



{/* 
  CONTRIBUTOR NOTE:
  ----------------
  This is a legacy document that is being deprecated.
  Please DO NOT make changes to this version.
  All updates should be directed to the new version at:
  /plugin-dev-en/9242-reverse-invocation-tool
*/}

<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin-dev-en/9242-reverse-invocation-tool">
  <p>This page is being phased out as part of our documentation reorganization.</p>
  
  <p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
  
  <p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
</Card>

When encountering the following scenarios:

* A tool-type plugin has implemented a feature but hasn't met expectations and needs data reprocessing
* A task requires web crawling and needs flexibility in choosing crawling services
* Need to combine multiple tools' return results but difficult to handle through Workflow applications

In these cases, you need to request other implemented tools within the plugin. These tools could be from marketplace tool plugins, self-built Workflow as a Tool, or custom tools.

The above requirements can be achieved by using the plugin's `self.session.tool` field.

### **Request Installed Tools**

Allows plugins to request various tools installed in the current Workspace, including other tool-type plugins.

**Entry**:

```python
self.session.tool
```

**Endpoint**:

```python
def invoke_builtin_tool(
    self, provider: str, tool_name: str, parameters: dict[str, Any]
) -> Generator[ToolInvokeMessage, None, None]:
    pass
```

Where `provider` is the plugin ID plus tool provider name, formatted like `langgenius/google/google`, `tool_name` is the specific tool name, and `parameters` are the parameters passed to that tool.

### **Request Workflow as Tool**

For more information about Workflow as Tool, please refer to this documentation.

**Entry**:

```python
self.session.tool
```

**Endpoint**:

```python
def invoke_workflow_tool(
    self, provider: str, tool_name: str, parameters: dict[str, Any]
) -> Generator[ToolInvokeMessage, None, None]:
    pass
```

Here, `provider` is the tool's ID, and `tool_name` is required when creating the tool.

**Request Custom Tool**

**Entry**:

```python
self.session.tool
```

**Endpoint**:

```python
def invoke_api_tool(
    self, provider: str, tool_name: str, parameters: dict[str, Any]
) -> Generator[ToolInvokeMessage, None, None]:
    pass
```

Here, `provider` is the tool's ID, `tool_name` is the `operation_id` in OpenAPI. If it doesn't exist, it's the `tool_name` automatically generated by Dify, which can be seen in the tool management page.

{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}

---

[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/plugins/schema-definition/reverse-invocation-of-the-dify-service/tool.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

