> For the complete documentation index, see [llms.txt](https://docs.tuannvm.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tuannvm.com/kafka-mcp-server/roots.md).

# Prompts for Managing Roots in a Kafka‑MCP‑Server

Roots let clients define which URIs the server should focus on—filesystem paths, API endpoints, configuration directories, and more. Below are useful prompts (slash‑commands or natural‑language) that you can expose in your Kafka‑MCP‑Server to let users and LLM agents manage roots interactively.

## 1. Slash‑Command Prompts

* `/kafka add-root <uri> name="<display-name>"`\
  “Register a new root at `<uri>` with the name `<display-name>`.”
* `/kafka list-roots`\
  “Show all currently registered roots (URI and name).”
* `/kafka update-root <uri> name="<new-name>"`\
  “Change the display name of the root at `<uri>` to `<new-name>`.”
* `/kafka remove-root <uri>`\
  “Unregister the root located at `<uri>`.”

## 2. Natural‑Language Prompts

* “Add a root for my local config directory: `file:///home/user/kafka/config` named ‘Broker Configs’.”
* “List all roots you’re using right now.”
* “Remove the API endpoint root `https://api.example.com/v1`.”
* “Rename the root `file:///var/logs` to ‘Kafka Logs’.”

## 3. Batch & Initialization Prompts

* “Initialize roots with:\
  • `file:///home/user/projects/kafka` as ‘Project Repo’\
  • `https://metrics.example.com/api` as ‘Metrics API’”
* “Reset roots to only include my current workspace folder.”

## 4. Validation & Discovery Prompts

* “Validate that all registered roots are accessible.”
* “Suggest roots based on the current working directory.”
* “Which roots contain configuration files?”

## 5. Examples in JSON Format

Expose these templates for clients that work with JSON payloads:

```json
{
  "roots": [
    { "uri": "file:///home/user/kafka/config", "name": "Broker Configs" },
    { "uri": "https://api.monitoring/v1",   "name": "Monitoring API" }
  ]
}
```

## Best Practices

* Use clear, descriptive **display names** to help LLMs and users understand purpose.
* Encourage **URI validation** to alert on unreachable roots.
* Allow **batch registration** of multiple roots for large workspaces.
* Support **dynamic updates** so roots can change as projects evolve.

These prompts empower conversational and programmatic control over which data sources and endpoints your Kafka‑MCP‑Server will surface to LLMs, ensuring context‑aware operations within defined boundaries.


---

# 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://docs.tuannvm.com/kafka-mcp-server/roots.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.
