Skip to main content
Glama

understand_question

Decompose user questions to clarify intent, surface constraints, and prepare structured prompts for accurate responses.

Instructions

Produce a protocol shell to decompose a user question.

    Args:
        question: The raw user ask to unpack.
        context: Optional background knowledge or situational frame.
        constraints: Explicit limits or success criteria.

    Returns:
        A structured prompt guiding the model to restate intent, surface
        constraints, and prepare clarifying questions before acting.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes
contextNo
constraintsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @mcp.tool()-decorated function that implements the core logic of the 'understand_question' tool. It validates input with Pydantic, normalizes fields, and generates a structured reasoning protocol template.
        @mcp.tool()
        def understand_question(
            question: str,
            context: Optional[str] = None,
            constraints: Optional[str] = None,
        ) -> str:
            """Produce a protocol shell to decompose a user question.
    
            Args:
                question: The raw user ask to unpack.
                context: Optional background knowledge or situational frame.
                constraints: Explicit limits or success criteria.
    
            Returns:
                A structured prompt guiding the model to restate intent, surface
                constraints, and prepare clarifying questions before acting.
            """
            # Validate input using Pydantic
            try:
                model = UnderstandQuestionInput(
                    question=question, context=context, constraints=constraints
                )
            except ValidationError as e:
                return f"Input Validation Error: {e}"
    
            normalized_context = model.context or "<none>"
            normalized_constraints = model.constraints or "<none>"
    
            template = """
    /reasoning.understand_question{{
        intent="Clarify the ask before solving by isolating intent, constraints, and required outputs",
        input={{
            question="{question}",
            context="{context}",
            constraints="{constraints}"
        }},
        process=[
            /intent_map{{action="Restate the core ask and target outcome"}},
            /constraints{{action="List explicit and implicit constraints"}},
            /decomposition{{action="Break request into solvable sub-goals"}},
            /risk_check{{action="Flag ambiguity or missing data"}}
        ],
        output={{
            intent="Single sentence goal statement",
            constraints="Bullet list of must-haves and guardrails",
            clarifications="Questions to close gaps before execution",
            proposed_plan="Initial steps or protocol to proceed"
        }}
    }}
    """
            return template.format(
                question=model.question,
                context=normalized_context,
                constraints=normalized_constraints,
            )
  • Pydantic BaseModel defining the input schema for the 'understand_question' tool, with validation rules for question, context, and constraints.
    class UnderstandQuestionInput(BaseModel):
        question: str = Field(..., min_length=3, description="The raw user ask to unpack.")
        context: Optional[str] = Field(None, description="Optional background knowledge.")
        constraints: Optional[str] = Field(
            None, description="Explicit limits or success criteria."
        )
  • Invocation of register_thinking_models(mcp) which registers the 'understand_question' tool (and others) on the FastMCP server instance.
    register_thinking_models(mcp)
  • The register_thinking_models function that defines and registers the 'understand_question' tool via @mcp.tool() decorator when called.
    def register_thinking_models(mcp: FastMCP) -> None:
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool produces a structured prompt but doesn't explain what a 'protocol shell' entails, how the decomposition works, or any operational constraints like processing limits or error conditions. For a tool with three parameters and no annotation coverage, this leaves key behavioral aspects unclear.

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 appropriately sized and front-loaded, with the core purpose stated first. The parameter explanations are clear and efficient, though the Returns section could be more concise. Overall, it avoids unnecessary verbosity while conveying essential information.

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 tool's complexity (3 parameters, no annotations) and the presence of an output schema, the description is moderately complete. It covers the purpose and parameters adequately but lacks usage guidance and detailed behavioral context. The output schema likely handles return value documentation, reducing the description's burden, but gaps remain in operational guidance.

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 description adds meaningful semantics beyond the input schema, which has 0% description coverage. It explains that 'question' is 'the raw user ask to unpack', 'context' is 'optional background knowledge or situational frame', and 'constraints' are 'explicit limits or success criteria'. This compensates well for the schema's lack of descriptions, though it doesn't provide format examples or validation rules.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Produce a protocol shell to decompose a user question.' This specifies both the action ('produce') and the resource ('protocol shell'), with additional context about unpacking the user ask. However, it doesn't explicitly differentiate this from sibling tools like 'get_protocol_shell' or 'get_prompt_program', which appear related.

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. While it mentions the tool's purpose, it doesn't indicate specific scenarios, prerequisites, or exclusions for its use. Given the presence of similar-sounding sibling tools, this lack of differentiation is a significant gap.

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

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/4rgon4ut/sutra'

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