remove-tag-from-entity
Remove specific tags from entities such as Kafka topics in Confluent Cloud using Schema Registry REST API, streamlining data management and organization.
Instructions
Remove tag from an entity in Confluent Cloud.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| baseUrl | No | The base URL of the Schema Registry REST API. | |
| qualifiedName | Yes | Qualified name of the entity. If not provided, you can obtain it from using the search-topics-by-tag tool. example: "lsrc-g2p81:lkc-xq8k7g:my-flights" | |
| tagName | Yes | Name of the tag to remove from the entity. | |
| typeName | No | Type of the entity | kafka_topic |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"baseUrl": {
"default": "",
"description": "The base URL of the Schema Registry REST API.",
"format": "uri",
"type": "string"
},
"qualifiedName": {
"description": "Qualified name of the entity. If not provided, you can obtain it from using the search-topics-by-tag tool. example: \"lsrc-g2p81:lkc-xq8k7g:my-flights\"",
"minLength": 1,
"type": "string"
},
"tagName": {
"description": "Name of the tag to remove from the entity.",
"minLength": 1,
"type": "string"
},
"typeName": {
"default": "kafka_topic",
"description": "Type of the entity",
"minLength": 1,
"type": "string"
}
},
"required": [
"tagName",
"qualifiedName"
],
"type": "object"
}
Implementation Reference
- Core handler logic: parses input arguments, optionally sets schema registry endpoint, wraps client, and sends DELETE request to /catalog/v1/entity/type/{typeName}/name/{qualifiedName}/tags/{tagName} to remove the tag.async handle( clientManager: ClientManager, toolArguments: Record<string, unknown>, ): Promise<CallToolResult> { const { tagName, typeName, qualifiedName, baseUrl } = removeTagFromEntityArguments.parse(toolArguments); if (baseUrl !== undefined && baseUrl !== "") { clientManager.setConfluentCloudSchemaRegistryEndpoint(baseUrl); } const pathBasedClient = wrapAsPathBasedClient( clientManager.getConfluentCloudSchemaRegistryRestClient(), ); const { response, error } = await pathBasedClient[ "/catalog/v1/entity/type/{typeName}/name/{qualifiedName}/tags/{tagName}" ].DELETE({ params: { path: { typeName, qualifiedName, tagName, }, }, }); if (error) { return this.createResponse( `Failed to remove tag from entity: ${JSON.stringify(error)}`, true, ); } return this.createResponse( `Successfully removed tag ${tagName} from entity ${qualifiedName} with type ${typeName}. Status: ${response?.status}`, ); }
- Zod schema defining the input parameters for the tool: baseUrl (optional), tagName (required), typeName (default 'kafka_topic'), qualifiedName (required).const removeTagFromEntityArguments = z.object({ baseUrl: z .string() .describe("The base URL of the Schema Registry REST API.") .url() .default(() => env.SCHEMA_REGISTRY_ENDPOINT ?? "") .optional(), tagName: z .string() .describe("Name of the tag to remove from the entity.") .nonempty(), typeName: z .string() .describe("Type of the entity") .nonempty() .default("kafka_topic"), qualifiedName: z .string() .describe( `Qualified name of the entity. If not provided, you can obtain it from using the ${ToolName.SEARCH_TOPICS_BY_TAG} tool. example: "lsrc-g2p81:lkc-xq8k7g:my-flights"`, ) .nonempty(), });
- src/confluent/tools/tool-factory.ts:57-57 (registration)Registration of RemoveTagFromEntityHandler instance in the ToolFactory's static handlers Map using the tool name constant.[ToolName.REMOVE_TAG_FROM_ENTITY, new RemoveTagFromEntityHandler()],
- Enum definition providing the exact string name 'remove-tag-from-entity' used for tool identification and registration.REMOVE_TAG_FROM_ENTITY = "remove-tag-from-entity",
- ToolConfig method returning the tool name, description, and input schema for MCP tool registration.getToolConfig(): ToolConfig { return { name: ToolName.REMOVE_TAG_FROM_ENTITY, description: "Remove tag from an entity in Confluent Cloud.", inputSchema: removeTagFromEntityArguments.shape, }; }