# render_tool

> **Function** in `langchain_cohere`

📖 [View in docs](https://reference.langchain.com/python/langchain-cohere/react_multi_hop/prompt/render_tool)

Renders a tool into prompt content. Either a `BaseTool` instance, or, a JSON
schema must be provided.

## Signature

```python
render_tool(
    tool: Optional[BaseTool] = None,
    json_schema: Optional[Dict] = None,
) -> str
```

## Description

**Example:**

```python
from langchain_cohere.react_multi_hop.prompt import render_tool

json_schema = {
    "name": "example_tool",
    "description": "A description of example_tool",
    "parameters": {
        "type": "object",
        "properties": {
            "foo": {"type": "string", "description": "A description of foo"},
            "bar": {"type": "integer", "description": "A description of bar"},
        },
        "required": ["foo"],
    },
}
print(render_tool(json_schema=json_schema))

tool = MyTool()
print(render_tool(tool=tool))
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tool` | `Optional[BaseTool]` | No | An instance of a `BaseTool`. (default: `None`) |
| `json_schema` | `Optional[Dict]` | No | `dict` containing the JSON schema representation of a tool. (default: `None`) |

## Returns

`str`

A string of prompt content.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-cohere/blob/24cfdaefd4e3c785f477ccfe491a4226a0dbe88c/libs/cohere/langchain_cohere/react_multi_hop/prompt.py#L90)