Skip to main content
Glama
aywengo

MCP Kafka Schema Reg

create_context_interactive

Create and manage metadata contexts interactively for Kafka Schema Registry. Elicits organizational details when metadata is missing, ensuring accurate and complete context setup.

Instructions

Interactive context creation with elicitation for metadata.

When context metadata is not provided, this tool will elicit organizational information from the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextYes
descriptionNo
environmentNo
ownerNo
registryNo
tagsNo

Implementation Reference

  • The main handler function for the 'create_context_interactive' tool. It checks if metadata fields are missing, elicits them using the elicitation system if needed, and then calls the core 'create_context_tool' to perform the actual context creation, augmenting the result with elicited metadata.
    async def create_context_interactive(
        context: str,
        registry: Optional[str] = None,
        # Additional metadata that could be elicited
        description: Optional[str] = None,
        owner: Optional[str] = None,
        environment: Optional[str] = None,
        tags: Optional[List[str]] = None,
        # Core tool dependencies injected
        create_context_tool=None,
        registry_manager=None,
        registry_mode=None,
        auth=None,
        headers=None,
        schema_registry_url=None,
    ) -> Dict[str, Any]:
        """
        Interactive context creation with elicitation for metadata.
    
        When context metadata is not provided, this tool will elicit
        organizational information from the user.
        """
        try:
            # Check if we should elicit metadata (any metadata field is None)
            needs_elicitation = any([description is None, owner is None, environment is None, tags is None])
    
            elicited_metadata = {}
    
            if needs_elicitation:
                logger.info(f"Context creation for '{context}' could benefit from metadata")
    
                # Create elicitation request for context metadata
                elicitation_request = create_context_metadata_elicitation(context_name=context)
    
                # Store the request for processing
                await elicitation_manager.create_request(elicitation_request)
    
                # Attempt elicitation with fallback
                response = await elicit_with_fallback(elicitation_request)
    
                if response and response.complete:
                    # Extract metadata from response
                    elicited_metadata = {
                        "description": response.values.get("description") or description,
                        "owner": response.values.get("owner") or owner,
                        "environment": response.values.get("environment") or environment,
                        "tags": (response.values.get("tags", "").split(",") if response.values.get("tags") else tags),
                    }
    
                    # Filter out empty values
                    elicited_metadata = {k: v for k, v in elicited_metadata.items() if v}
    
                    logger.info(f"Collected context metadata from elicitation: {list(elicited_metadata.keys())}")
    
            # Now proceed with the actual context creation
            result = create_context_tool(
                context=context,
                registry_manager=registry_manager,
                registry_mode=registry_mode,
                registry=registry,
                auth=auth,
                headers=headers,
                schema_registry_url=schema_registry_url,
            )
    
            # Add metadata to successful result
            if isinstance(result, dict) and "error" not in result:
                result["elicitation_used"] = needs_elicitation
                if elicited_metadata:
                    result["metadata"] = elicited_metadata
                    result["metadata_note"] = (
                        "Context created with elicited metadata. Store this information in your documentation system."
                    )
    
            return result
    
        except Exception as e:
            logger.error(f"Error in interactive context creation: {str(e)}")
            return create_error_response(
                f"Interactive context creation failed: {str(e)}",
                error_code="INTERACTIVE_CONTEXT_ERROR",
            )
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'elicitation for metadata' and that it 'will elicit organizational information from the user' when metadata is missing, which adds some behavioral context. However, it doesn't disclose whether this is a read or write operation, what permissions are needed, whether it's destructive, or what the response looks like. For a tool with no annotations, this leaves significant gaps.

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 brief (two sentences) and front-loaded with the main purpose. Every sentence adds value: the first states the tool's function, and the second explains its interactive behavior. No wasted words, though it could be slightly more structured.

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

Completeness2/5

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

Given 6 parameters with 0% schema coverage, no annotations, no output schema, and complexity implied by 'interactive' and 'elicitation', the description is incomplete. It doesn't explain what 'context' is, how elicitation works, what metadata fields are involved, or what the tool returns. This leaves too many unknowns for effective use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'metadata' and 'organizational information' but doesn't explain what the 6 parameters (context, description, environment, owner, registry, tags) mean or how they relate to metadata elicitation. The description adds minimal value beyond the schema, failing to clarify parameter purposes.

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 'Interactive context creation with elicitation for metadata' which provides a verb ('create') and resource ('context'), but is vague about what 'context' means in this system. It distinguishes from sibling 'create_context' by mentioning 'interactive' and 'elicitation', but doesn't clarify what makes it interactive versus the non-interactive version.

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

Usage Guidelines3/5

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

The description implies when to use this tool ('When context metadata is not provided'), suggesting it's for cases where metadata is missing. However, it doesn't explicitly state when to choose this over 'create_context' or other alternatives, nor does it mention prerequisites or exclusions.

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