> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/agentic-commerce-intelligence/agentic-intelligence/agent-library/dynamic-mcp-tool-agent.md).

# Agentic Dynamic MCP Tool Assistant

The Agentic Dynamic MCP Tool Assistant infers a complete MCP tool definition from Cloud Function source when you configure a dynamic MCP server.

The **Agentic Dynamic MCP Tool Assistant** is a configuration helper agent for the Agentic management experience. It analyzes the latest Cloud Function deployment and fills in the tool contract on a [dynamic MCP server](/agentic-commerce-intelligence/agentic-intelligence/configuration/custom-mcp.md#configuring-a-dynamic-mcp-server).

Unlike workflow agents that run in production to handle business processes, the Dynamic MCP Tool Assistant supports MCP setup. It reduces the need to author the tool name, prompt, schema, and scopes by hand when the implementation already exists as a hosted Cloud Function.

## Purpose

The agent's purpose is to generate a complete MCP tool definition from Cloud Function source. After you select a function on a dynamic MCP server, the assistant infers how agents can call that function: the tool name, when to use it, the HTTP method, where arguments are sent, the input schema, and the IAM scopes the function needs.

It infers behavior only from the source. It does not invent operations, fields, or scopes that the function does not implement.

## Key benefits

Once you enable the assistant, it is available when you bind a Cloud Function in **Agentic AI** -> **AI MCP**. Review the proposal, then choose **Apply** to fill the tool fields.

| Benefit                       | Description                                                                                                                                 |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **Tool contract from source** | Derives name, description, prompt, method, argument location, input schema, and required scopes from the latest deployment.                 |
| **Business arguments only**   | The input schema describes path, query, or body data the calling agent supplies. Platform identity and HTTP headers stay out of the schema. |
| **Available in AI MCP**       | Starts from the **Generate tool from cloud function** dialog after you select a Cloud Function.                                             |
| **Scope alignment**           | Places inferred Emporix IAM scopes on **Required scopes**, not as agent-facing input properties.                                            |

## How it works

When you select a Cloud Function on a dynamic MCP server, the **Generate tool from cloud function** dialog opens. The assistant receives the function ID, optional name and runtime, and the source files from the latest deployment.

It then proposes values for the tool fields:

* **Tool name** – A unique identifier that reflects the function's purpose, not the deployment ID. The name uses letters, numbers, and underscores only, typically in snake\_case, with no spaces or hyphens.
* **Description** – One or two sentences that state what the tool does.
* **Tool prompt** – An instruction that tells another agent when to call the tool.
* **HTTP method** – `GET`, `POST`, `PUT`, `PATCH`, or `DELETE`, inferred from the HTTP handler in the source. If the method is unclear, the assistant uses `POST`.
* **Arguments location** – **Request body** or **Query string**, matching how the function reads input. `GET` typically uses the query string; JSON bodies typically use the request body.
* **Input schema** – A JSON Schema object for the incoming business arguments only. Required fields are marked only when the source clearly requires them. If the function takes no input, the schema is an empty object.
* **Required scopes** – IAM scope strings implied by Emporix API usage in the source. If none can be inferred, the list is empty.

The input schema never includes platform identity, authentication, or HTTP headers. Values the function reads from headers such as `emporix-token`, `emporix-tenant`, `emporix-scopes`, `emporix-user-id`, `emporix-session-id`, and `emporix-legal-entity-id` are injected at runtime and are not agent-facing arguments. Environment variables and hardcoded outbound API parameters are also omitted. If the function copies a header value into an upstream URL or body, that value still stays out of the schema.

Choose **Apply** to fill the fields, or **Discard** to leave them empty. You can edit any field afterwards.

### Trigger

{% hint style="info" %}
The Agentic Dynamic MCP Tool Assistant is listed in **Predefined Agents** from the start, so you can enable it from the [AI Agent Library](/agentic-commerce-intelligence/agentic-intelligence/agent-library.md) at any time.

If the assistant is not enabled yet, the first time you select a Cloud Function on a dynamic MCP server, you are prompted to enable it. Select **Enable Helper Agent** to create it from the predefined template. After that, it is available in the **Generate tool from cloud function** dialog.

For the MCP configuration flow, see [Configuring a dynamic MCP server](/agentic-commerce-intelligence/agentic-intelligence/configuration/custom-mcp.md#configuring-a-dynamic-mcp-server).
{% endhint %}

## Agent configuration

Once you enable the Agentic Dynamic MCP Tool Assistant from the dedicated template, you can adjust its configuration in the Agents Library like other predefined agents.

### User prompt

The default prompt instructs the assistant to infer a complete MCP tool definition from Cloud Function source. It is optimized for dynamic MCP setup: map only incoming business arguments into the input schema, put IAM scopes on **Required scopes**, and omit platform headers, environment variables, and fields taken from outbound API calls.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.emporix.io/agentic-commerce-intelligence/agentic-intelligence/agent-library/dynamic-mcp-tool-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
