Skip to main content
Glama
nanyang12138

AI Research MCP Server

by nanyang12138

get_trending_repos

Retrieve trending AI/ML repositories from GitHub to track emerging projects and research developments, with options to filter by time period, programming language, and result count.

Instructions

Get trending AI/ML repositories on GitHub

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoTime period for trendingweekly
languageNoFilter by programming language
max_resultsNoMaximum number of results

Implementation Reference

  • Primary handler for the get_trending_repos tool. Handles caching, invokes the GitHub client method, formats results, and returns markdown.
    async def _get_trending_repos(
        self,
        period: str = "weekly",
        language: Optional[str] = None,
        max_results: int = 25,
    ) -> str:
        """Get trending repositories."""
        cache_key = f"github_trending_{period}_{language}"
        cached = self.cache.get(cache_key, 3600)  # 1 hour cache
        if cached:
            repos = cached
        else:
            repos = await asyncio.to_thread(
                self.github.get_trending_repositories,
                period=period,
                language=language,
                max_results=max_results,
            )
            self.cache.set(cache_key, repos)
        
        return self._format_repos(repos)
  • Registers the get_trending_repos tool in list_tools(), including name, description, and input schema.
    Tool(
        name="get_trending_repos",
        description="Get trending AI/ML repositories on GitHub",
        inputSchema={
            "type": "object",
            "properties": {
                "period": {
                    "type": "string",
                    "enum": ["daily", "weekly", "monthly"],
                    "description": "Time period for trending",
                    "default": "weekly",
                },
                "language": {
                    "type": "string",
                    "description": "Filter by programming language",
                },
                "max_results": {
                    "type": "integer",
                    "description": "Maximum number of results",
                    "default": 25,
                },
            },
        },
    ),
  • Helper method in GithubClient that implements the core logic for fetching trending repositories by approximating via search with recent pushes, AI topics, and star sorting.
    def get_trending_repositories(
        self,
        period: str = "daily",
        language: Optional[str] = None,
        max_results: int = 25,
    ) -> List[Dict]:
        """Get trending repositories.
        
        Note: GitHub API doesn't have official trending endpoint, so we approximate
        by searching for recently created/updated repos with high stars.
        
        Args:
            period: 'daily', 'weekly', or 'monthly'
            language: Programming language filter
            max_results: Maximum number of results
            
        Returns:
            List of repository dictionaries
        """
        # Map period to days
        period_days = {
            "daily": 1,
            "weekly": 7,
            "monthly": 30,
        }
        days = period_days.get(period, 7)
        
        # Search for recently starred repos with AI topics
        return self.search_repositories(
            topics=self.AI_TOPICS[:5],  # Use top 5 most common topics
            min_stars=100,
            language=language,
            pushed_since=f"{days}d",
            sort_by="stars",
            max_results=max_results,
        )
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 of behavioral disclosure. It states the tool retrieves trending repositories but doesn't mention any behavioral traits such as rate limits, authentication needs, data freshness, or what the output format looks like. This is a significant gap for a tool with potential external API calls.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It's appropriately sized for a straightforward tool, making it easy for an agent to parse quickly.

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 the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of repos with details), any limitations, or how it interacts with siblings. For a tool that likely involves external data fetching, more context is needed to guide effective use.

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

Parameters3/5

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

The input schema has 100% description coverage, clearly documenting all three parameters with enums and defaults. The description adds no additional semantic context beyond implying filtering by AI/ML, which isn't reflected in the parameters. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Get') and resource ('trending AI/ML repositories on GitHub'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_github_repos' or 'get_trending_models', which could handle similar content, so it misses the top score.

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. With siblings like 'search_github_repos' and 'get_trending_models' available, there's no indication of context, exclusions, or prerequisites, leaving the agent to guess based on tool names 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

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/nanyang12138/AI-Research-MCP'

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