Skip to main content
Glama
aywengo

MCP Kafka Schema Reg

guided_context_reorganization

Initiate schema reorganization across contexts to streamline Kafka Schema Registry management, ensuring structured and efficient schema alignment.

Instructions

Start the Context Reorganization workflow for reorganizing schemas across contexts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Primary handler and registration (via @self.mcp.tool decorator) for the guided_context_reorganization tool. Starts the multi-step context_reorganization workflow.
    @self.mcp.tool(description="Start the Context Reorganization workflow for reorganizing schemas across contexts")
    async def guided_context_reorganization() -> str:
        """Convenience method to start Context Reorganization workflow."""
        workflow_id = "context_reorganization"
    
        try:
            request = await self.multi_step_manager.start_workflow(workflow_id=workflow_id, initial_context={})
    
            if request:
                return json.dumps(
                    {
                        "status": "started",
                        "workflow_id": workflow_id,
                        "workflow_name": "Context Reorganization",
                        "request_id": request.id,
                        "first_step": request.title,
                        "description": request.description,
                        "message": (
                            "Context Reorganization workflow started. This workflow will guide you through:\n"
                            "1. Current context analysis\n"
                            "2. Target context design\n"
                            "3. Schema migration planning\n"
                            "4. Context restructuring execution"
                        ),
                    }
                )
            else:
                return json.dumps({"error": "Failed to start Context Reorganization workflow"})
        except Exception as e:
            logger.error(f"Error starting Context Reorganization workflow: {str(e)}")
            return json.dumps({"error": f"Failed to start workflow: {str(e)}"})
  • Helper function that converts workflow responses into a structured execution plan for context reorganization strategies including merge, split, rename, and restructure.
    def execute_context_reorganization(responses: Dict[str, Any]) -> Dict[str, Any]:
        """Execute context reorganization based on workflow responses."""
        strategy = responses.get("strategy")
    
        result = {"operation": "context_reorganization", "strategy": strategy, "status": "pending"}
    
        # Add strategy-specific parameters
        if strategy == "merge":
            result["source_contexts"] = [ctx.strip() for ctx in responses.get("source_contexts", "").split(",")]
            result["target_context"] = responses.get("target_context")
            result["handle_duplicates"] = responses.get("handle_duplicates")
        elif strategy == "split":
            result["source_context"] = responses.get("source_context")
            result["split_criteria"] = responses.get("split_criteria")
            result["target_contexts"] = [ctx.strip() for ctx in responses.get("target_contexts", "").split(",")]
            result["split_rules"] = responses.get("split_rules")
        elif strategy == "rename":
            rename_mappings: Dict[str, str] = {}
            mappings_str = responses.get("rename_mappings", "")
            if mappings_str and isinstance(mappings_str, str):
                mappings = [mapping.strip() for mapping in mappings_str.split(",")]
                for mapping in mappings:
                    if ":" in mapping and isinstance(mapping, str):
                        old, new = mapping.split(":", 1)
                        if old and new:
                            rename_mappings[old.strip()] = new.strip()
            result["rename_mappings"] = rename_mappings
        elif strategy == "restructure":
            result["structure_definition"] = responses.get("structure_definition")
            result["migration_strategy"] = responses.get("migration_strategy")
    
        # Add common options
        result["options"] = {
            "backup_first": responses.get("backup_first") == "true",
            "test_mode": responses.get("test_mode") == "true",
            "generate_report": responses.get("generate_report") == "true",
        }
    
        return result
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions starting a workflow but doesn't disclose behavioral traits such as whether this is a long-running operation, what permissions are required, if it's interactive or automated, or what happens to existing schemas. The description is too vague for a workflow tool with potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's action. It's front-loaded with the key verb 'Start' and avoids unnecessary words. However, it could be slightly more informative without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a workflow tool (likely involving schema reorganization across contexts), the description is minimal. No annotations are provided, but an output schema exists, so return values are covered. However, the description lacks details on workflow behavior, prerequisites, or outcomes, making it incomplete for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate. A baseline of 4 is given since the schema fully covers the lack of parameters, and the description doesn't need to compensate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Start[s] the Context Reorganization workflow for reorganizing schemas across contexts', which provides a clear verb ('Start') and resource ('Context Reorganization workflow'). However, it doesn't distinguish this from sibling tools like 'guided_schema_migration' or 'guided_schema_evolution', which also appear to be guided workflows. The purpose is understandable but lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, when this workflow is appropriate compared to other bulk operations or guided workflows in the sibling list, or any exclusions. The user must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aywengo/kafka-schema-reg-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server