Skip to main content
Glama

list_sources

Display each indexed source for youth opportunities, showing the number of opportunities contributed and the time of last refresh.

Instructions

List indexed sources, the count each contributed, and last-refresh time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The list_sources tool handler function. Decorated with @mcp.tool(), it queries the index for source statistics (count and last_refreshed) and merges them with the static SOURCES registry (name, homepage) to return a list of source info dicts.
    @mcp.tool()
    def list_sources() -> list[dict]:
        """List indexed sources, the count each contributed, and last-refresh time."""
        stats = {row["source_site"]: row for row in _get_index().source_stats()}
        out = []
        for adapter in SOURCES:
            s = stats.get(adapter.name, {})
            out.append(
                {
                    "name": adapter.name,
                    "homepage": adapter.homepage,
                    "count": s.get("count", 0),
                    "last_refreshed": s.get("last_refreshed"),
                }
            )
        return out
  • The source_stats() method on the Index class that runs a SQL GROUP BY query on the opportunities table to return per-source counts and max scraped_at timestamps.
    def source_stats(self) -> list[dict]:
        rows = self.conn.execute(
            """
            SELECT source_site,
                   COUNT(*) AS count,
                   MAX(scraped_at) AS last_refreshed
            FROM opportunities
            GROUP BY source_site
            ORDER BY source_site
            """
        ).fetchall()
        return [dict(r) for r in rows]
  • Registration via the @mcp.tool() decorator on the list_sources function, which registers it as an MCP tool named 'list_sources'.
    @mcp.tool()
  • The SOURCES list: a registry of 7 RSSAdapter instances with name and homepage used by list_sources to compile the output.
    SOURCES: list[SourceAdapter] = [
        RSSAdapter(
            name="opportunities_corners",
            homepage="https://opportunitiescorners.com/",
            feed_url="https://opportunitiescorners.com/feed/",
        ),
        RSSAdapter(
            name="opportunities_for_youth",
            homepage="https://opportunitiesforyouth.org/",
            feed_url="https://opportunitiesforyouth.org/feed/",
        ),
        RSSAdapter(
            name="opportunity_desk",
            homepage="https://opportunitydesk.org/",
            feed_url="https://opportunitydesk.org/feed/",
        ),
        RSSAdapter(
            name="scholarships_corner",
            homepage="https://scholarshipscorner.website/",
            feed_url="https://scholarshipscorner.website/feed/",
        ),
        RSSAdapter(
            name="opportunities_circle",
            homepage="https://www.opportunitiescircle.com/",
            feed_url="https://www.opportunitiescircle.com/feed/",
        ),
        RSSAdapter(
            name="opportunities_for_africans",
            homepage="https://www.opportunitiesforafricans.com/",
            feed_url="https://www.opportunitiesforafricans.com/feed/",
        ),
        RSSAdapter(
            name="scholars4dev",
            homepage="https://www.scholars4dev.com/",
            feed_url="https://www.scholars4dev.com/feed/",
        ),
    ]
Behavior2/5

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

No annotations provided, and the description does not disclose behavioral traits beyond the basic operation. It fails to mention whether it is read-only, if authentication is needed, or any side effects. For a tool with no annotations, the description should provide more transparency.

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, concise sentence that front-loads the core purpose without extraneous information. Every phrase adds value.

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 no output schema is shown (though marked present), the description adequately explains the returned data. It covers the main elements but omits potential details like sorting or pagination.

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 input schema has zero parameters, so the description adds meaningful context by specifying what the output includes (count and refresh time). This compensates well for the lack of parameter documentation.

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?

The description clearly states the action (list), the resource (indexed sources), and the specific details included (count each contributed, last-refresh time). It distinguishes itself from sibling tools like search_opportunities and refresh_index.

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 does not explicitly state when to use this tool versus alternatives. Usage context is implied as a simple listing, but no guidance on when not to use or when to prefer siblings like refresh_index.

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/revolutionarybukhari/opportunity-mcp'

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