> For the complete documentation index, see [llms.txt](https://raia2.gitbook.io/raia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://raia2.gitbook.io/raia/integrations/agent-to-agent-setup.md).

# Agent-to-Agent Setup

When wanting to connect Agents (allowing one agent to call another agent) we use our Functions Skill.

We provide a general Webhook that can be used if you pass the specific Agent API Key you want to call with the function.

The first step is to setup a Function under the Agent (function skill)

<figure><img src="/files/bZfUvxvualyrghkClx9g" alt=""><figcaption></figcaption></figure>

The Function Skill will pass the query to the other Agent for a response and include back into the conversation.\
\
**To Setup:**\
\
Provide Function instructions on when the Agent should call the other agent (essentially added to the core prompt for the AI to look for this prompt to trigger the function)\
\
**Webhook**

To use our generic A2A Webhook - use this URL:

<https://raia.app.n8n.cloud/webhook/e60457a0-bc4a-47c3-bae2-3b690db3dee1>

Provide Function Parameters (which for this use case we just need to pass the question the user prompted into the agent

**Function Instructions:**

```
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string"
    }
  }
}
```

**Header Variable**

Next, add a Header Variable using the following:\
\
Header Name = Call\_Agent\_APIKEY

Header Value = { API Key of the Agent you want to call }

<figure><img src="/files/Z0OhfBreE8g2FDTF3BDE" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://raia2.gitbook.io/raia/integrations/agent-to-agent-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
