Skip to main content
Glama
salwks

mcp-techTrend

github_trending

Read-only

Browse trending repositories on GitHub's public trending feed without specifying a topic.

Instructions

Browse github.com/trending — the public 'what's hot now' feed. USE THIS WHEN: user wants to browse trending repos with no specific topic in mind ('파이썬 트렌딩 보여줘', 'GitHub 핫한 거'). USE github_search INSTEAD WHEN: user has a specific topic/keyword. Note: this is HTML scraping (no official API), so layout changes can break it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNo
sinceNodaily
max_resultsNo
response_formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual async function that executes the github_trending tool logic: scrapes github.com/trending HTML, parses repo names, descriptions, languages, stars, forks, and period stars, then returns formatted markdown.
    async def github_trending(
        language: str | None = None,
        since: str = "daily",
        max_results: int = 25,
        response_format: ResponseFormat = ResponseFormat.MARKDOWN,
    ) -> str:
        try:
            args = GitHubTrendingInput(
                language=language, since=since, max_results=max_results, response_format=response_format
            )
            url = GITHUB_TRENDING + (f"/{args.language}" if args.language else "")
            # Trending UI pulses fast — keep TTL short.
            text = await _http_get_text(url, params={"since": args.since}, ttl=TTL_TRENDING)
            soup = BeautifulSoup(text, "html.parser")
            articles = soup.select("article.Box-row")
            repos: list[dict[str, Any]] = []
            for art in articles[: args.max_results]:
                h2 = art.select_one("h2 a")
                if not h2:
                    continue
                href = h2.get("href", "").strip()
                full_name = re.sub(r"\s+", "", h2.get_text()).strip("/")
                desc_el = art.select_one("p")
                desc = desc_el.get_text(strip=True) if desc_el else ""
                lang_el = art.select_one('[itemprop="programmingLanguage"]')
                language_v = lang_el.get_text(strip=True) if lang_el else None
                stars = 0
                forks = 0
                for a in art.select("a.Link--muted"):
                    ah = a.get("href", "")
                    num_text = a.get_text(strip=True).replace(",", "")
                    m = re.search(r"\d+", num_text)
                    if not m:
                        continue
                    n = int(m.group())
                    if ah.endswith("/stargazers"):
                        stars = n
                    elif ah.endswith("/forks") or ah.endswith("/network/members"):
                        forks = n
                period_el = art.select_one("span.d-inline-block.float-sm-right")
                stars_period = None
                if period_el:
                    pm = re.search(r"[\d,]+", period_el.get_text())
                    if pm:
                        stars_period = int(pm.group().replace(",", ""))
                repos.append(
                    {
                        "full_name": full_name,
                        "url": "https://github.com" + href if href.startswith("/") else href,
                        "description": desc,
                        "language": language_v,
                        "stars": stars,
                        "forks": forks,
                        "stars_period": stars_period,
                    }
                )
            header = f"GitHub Trending — {args.since}" + (f" · {args.language}" if args.language else "")
            return _format(repos, args.response_format, render_md=lambda x: _render_github_md(x, header))
        except Exception as e:
            return _handle_error(e, "github_trending")
  • Pydantic model GitHubTrendingInput defines the input schema: language (optional), since (daily/weekly/monthly), max_results (1-25), response_format.
    class GitHubTrendingInput(BaseModel):
        model_config = ConfigDict(str_strip_whitespace=True, extra="forbid")
        language: str | None = Field(None, max_length=40)
        since: str = Field("daily", pattern=r"^(daily|weekly|monthly)$")
        max_results: int = Field(25, ge=1, le=25)
        response_format: ResponseFormat = ResponseFormat.MARKDOWN
  • trends_mcp.py:818-834 (registration)
    Registration via @_maybe_tool decorator: source='github', name='github_trending', with MCP annotations. The decorator conditionally registers with FastMCP only if 'github' is in ENABLED_SOURCES.
    @_maybe_tool(
        source="github",
        name="github_trending",
        description=(
            "Browse github.com/trending — the public 'what's hot now' feed. "
            "USE THIS WHEN: user wants to browse trending repos with no specific "
            "topic in mind ('파이썬 트렌딩 보여줘', 'GitHub 핫한 거'). "
            "USE github_search INSTEAD WHEN: user has a specific topic/keyword. "
            "Note: this is HTML scraping (no official API), so layout changes can break it."
        ),
        annotations={
            "readOnlyHint": True,
            "destructiveHint": False,
            "openWorldHint": True,
            "idempotentHint": False,
        },
    )
  • Helper function _render_github_md converts repo data dicts into a markdown-formatted string with headers, stars, forks, and descriptions.
    def _render_github_md(items: list[dict[str, Any]], header: str) -> str:
        if not items:
            return f"# {header}\n\n_결과 없음_"
        lines = [f"# {header}", f"_총 {len(items)}건_", ""]
        for i, r in enumerate(items, 1):
            bits: list[str] = []
            if r.get("language"):
                bits.append(str(r["language"]))
            bits.append(f"⭐{r.get('stars', 0):,}")
            if "forks" in r and r["forks"] is not None:
                bits.append(f"🍴{r['forks']:,}")
            if r.get("stars_period"):
                bits.append(f"📈+{r['stars_period']:,}")
            meta = " · ".join(bits)
            desc = _trim(r.get("description"), 200)
            lines.append(
                f"## {i}. [{r['full_name']}]({r['url']})\n"
                f"- {meta}\n"
                + (f"- {desc}\n" if desc else "")
            )
        return "\n".join(lines)
Behavior4/5

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

Description adds important behavioral info beyond annotations: it notes HTML scraping and potential breakage due to layout changes. This is valuable context not captured by readOnlyHint or other annotations.

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?

Description is extremely concise with three sentences: purpose, usage guidance, and a critical note. No wasted words, front-loaded with key information.

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

Completeness4/5

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

Given the tool's moderate complexity (scraping, 4 params) and the presence of an output schema, the description covers the main use cases and risk (scraping fragility). Could mention result count limits or format details, but overall sufficient.

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%, placing full burden on description. Description does not explain parameters like 'language' values, 'since' options (daily/weekly/monthly), or 'max_results' usage, leaving significant gaps for an agent to correctly invoke the tool.

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

Purpose5/5

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

Description clearly states 'Browse github.com/trending' with a specific verb and resource, and distinguishes itself from sibling github_search by noting the no-specific-topic use case.

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

Usage Guidelines5/5

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

Explicitly provides when to use this tool (browsing trending with no specific topic) and when to use github_search instead (specific topic/keyword), offering clear decision guidance.

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/salwks/mcp-techTrend'

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