Skip to main content
Glama

tool_classify_research_intent

Analyze queries to identify research goals like quick answers, deep research, or documentation, providing confidence scores for each intent classification.

Instructions

Classify the research intent of a query.

Analyzes a query to determine the user's research goal (quick answer, deep research, documentation, comparison, discovery, or monitoring). Returns confidence scores for each detected intent.

Args: query: Research question or task description.

Returns: Dictionary with primary and secondary intents with confidence scores.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • Tool handler definition for classify_research_intent, which uses the classify_intent helper function to categorize the user's research intent.
    @mcp.tool()
    def tool_classify_research_intent(query: str) -> dict:
        """Classify the research intent of a query.
    
        Analyzes a query to determine the user's research goal (quick answer,
        deep research, documentation, comparison, discovery, or monitoring).
        Returns confidence scores for each detected intent.
    
        Args:
            query: Research question or task description.
    
        Returns:
            Dictionary with primary and secondary intents with confidence scores.
        """
        intent_scores = classify_intent(query)
    
        return {
            "primary_intent": {
                "type": intent_scores[0].intent.value,
                "confidence": intent_scores[0].confidence,
                "reasons": intent_scores[0].reasons,
                "keywords": intent_scores[0].keywords_matched,
            },
            "secondary_intents": [
                {
                    "type": score.intent.value,
                    "confidence": score.confidence,
                    "reasons": score.reasons,
                    "keywords": score.keywords_matched,
                }
                for score in intent_scores[1:3]
            ]
            if len(intent_scores) > 1
            else [],
        }

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/Y4NN777/devlens-mcp'

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