> For the complete documentation index, see [llms.txt](https://gdplabs.gitbook.io/glchat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gdplabs.gitbook.io/glchat/developer-documentation/pipeline-as-a-tool.md).

# Pipeline as a Tool

> **Related page:** [Tool API Endpoint](/glchat/developer-documentation/glchat-pipeline/pipeline/custom-pipeline-development-guide/custom-internal-pipeline/advanced-configuration.md#building-tools)

The Standard RAG pipeline exposes **two built-in tools** that can be called directly via the Component API, without going through a full chat message flow. This is useful for integrations, agent workflows, or any scenario where you want retrieval or generation as a standalone operation.

### Available Tools

| Tool Name            | Description                                      | Subpage                                                                                                  |
| -------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| `standard-rag`       | Full RAG: retrieval + LLM answer generation      | [Standard RAG Tool](/glchat/developer-documentation/pipeline-as-a-tool/standard-rag-tool.md)             |
| `retrieval-pipeline` | Retrieval only: fetch chunks from knowledge base | [Retrieval Pipeline Tool](/glchat/developer-documentation/pipeline-as-a-tool/retrieval-pipeline-tool.md) |

The tool name is used as part of the `component_id` in the endpoint:

```
POST /components/{chatbot_slug}:{tool_name}/run
```

> **`{chatbot_slug}`** is the chatbot's human-readable slug (e.g. `general-purpose`) — **not** the UUID shown in the dashboard's chatbot list. Find the slug in the chatbot's settings page or in its dashboard URL. Passing the UUID instead of the slug returns a `404` with `"Chatbot '<value>' not found"`.

### Authentication

All tools require a **User API Key** passed via the `X-API-Key` header. See [API Authentication Flow](/glchat/sdk/resources/api-references/glchat-backend-api/api-authentication-flow.md#how-to-get-your-user-api-key) for the key format, how to obtain and rotate it, expiration policy, version requirements, and multi-tenancy via `X-Tenant-Id`.

The calling user must have the `SEND_MESSAGE` permission and access to the target chatbot.

### Request Body

All tools share the same top-level request shape:

```json
{
  "inputs": { ... },
  "config": { ... },
  "model_name": "..."
}
```

<table><thead><tr><th>Field</th><th>Type</th><th width="130.1666259765625">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>inputs</code></td><td><code>dict</code></td><td>Yes</td><td>Tool-specific inputs — see each tool's subpage for the full schema</td></tr><tr><td><code>config</code></td><td><code>dict</code></td><td>Yes</td><td>Runtime configuration overrides — see <a href="/pages/ISFgfiid70THVQ6bXRr8">Runtime Config</a></td></tr><tr><td><code>model_name</code></td><td><code>string</code> / <code>null</code></td><td>No</td><td>LLM model identifier. Must exactly match one of the models enabled for the target chatbot in the admin dashboard's model configuration — see note below. Falls back to the chatbot's first enabled model if omitted.</td></tr></tbody></table>

> **Finding a valid `model_name`:** open the target chatbot in the admin dashboard and use the exact identifier shown for one of its enabled models — this is the value the backend matches against, and it does not necessarily follow a `provider/model` convention.\
> Passing an unenabled or misspelled value returns:
>
> ```
> "Model <model_name> is not supported"
> ```
>
> **Example** (for a chatbot with `Gemini 3.1 Flash Lite` enabled):
>
> ```json
> {
>   "inputs": { "query": "What is our refund policy?" },
>   "config": {},
>   "model_name": "Gemini 3.1 Flash Lite"
> }
> ```

### Full Endpoint Example

```bash
curl -X POST "https://glchat-api.glair.ai/components/general-purpose:standard-rag/run" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: {your_user_api_key}" \
  -d '{
    "inputs": {
      "query": "What is our refund policy?"
    },
    "config": {}
  }'
```
