> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pubmed

> Search PubMed for articles with PubmedTools' search_pubmed function, returning expanded article detail when results_expanded is set.

**PubmedTools** enable an Agent to search PubMed for articles.

## Prerequisites

The following example requires the `openai` library.

```shell theme={null}
uv pip install -U openai
```

## Example

The following agent will search PubMed for articles related to "ulcerative colitis".

```python cookbook/91_tools/pubmed_tools.py theme={null}
from agno.agent import Agent
from agno.tools.pubmed import PubmedTools

agent = Agent(tools=[PubmedTools()])
agent.print_response("Tell me about ulcerative colitis.")
```

## Toolkit Params

| Parameter              | Type            | Default                    | Description                                                                                     |
| ---------------------- | --------------- | -------------------------- | ----------------------------------------------------------------------------------------------- |
| `email`                | `str`           | `"your_email@example.com"` | Specifies the email address to use.                                                             |
| `max_results`          | `Optional[int]` | `None`                     | Optional parameter to specify the maximum number of results to return.                          |
| `results_expanded`     | `bool`          | `False`                    | Return expanded article details including author, journal, DOI, URLs, keywords, and MeSH terms. |
| `enable_search_pubmed` | `bool`          | `True`                     | Enable the search\_pubmed functionality.                                                        |
| `all`                  | `bool`          | `False`                    | Enable all functionality.                                                                       |

## Toolkit Functions

| Function        | Description                                                                                                                                                                                                                                                                                 |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `search_pubmed` | Searches PubMed for articles based on a specified query. Parameters include `query` for the search term and `max_results` for the maximum number of results to return (default is 10). Returns a JSON string containing the search results, including publication date, title, and summary. |

## Developer Resources

* [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/pubmed.py)
