Skip to main content
Glama

get_opportunity

Retrieve full details for a single youth opportunity by providing its ID. Access aggregated data on scholarships, fellowships, internships, conferences, and exchange programs.

Instructions

Get full details for a single opportunity by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The get_opportunity MCP tool handler function. Decorated with @mcp.tool(), takes an 'id' string parameter and returns an Opportunity or None. Delegates to _get_index().get(id).
    @mcp.tool()
    def get_opportunity(id: str) -> Opportunity | None:
        """Get full details for a single opportunity by ID."""
        return _get_index().get(id)
  • The Index.get() method that performs the actual database lookup by SELECTing from the opportunities table WHERE id = ?. Returns an Opportunity object via _row_to_opportunity() or None if not found.
    def get(self, opp_id: str) -> Opportunity | None:
        row = self.conn.execute(
            "SELECT * FROM opportunities WHERE id = ?", (opp_id,)
        ).fetchone()
        return _row_to_opportunity(row) if row else None
  • The Opportunity Pydantic model returned by get_opportunity. Defines all fields (id, title, type, summary, deadline, funded, etc.) with validation.
    class Opportunity(BaseModel):
        """A single opportunity record. The shape every adapter must produce."""
    
        model_config = ConfigDict(use_enum_values=False)
    
        id: str = Field(..., description="sha1(source + canonical_url)[:16]")
        title: str
        type: OpportunityType
        summary: str = Field(..., max_length=500)
        deadline: date | None = None
        funded: FundingLevel = FundingLevel.UNKNOWN
        eligible_countries: list[str] | Literal["worldwide"] | None = None
        eligible_levels: list[StudyLevel] = Field(default_factory=list)
        host_country: str | None = None
        apply_url: AnyHttpUrl
        source_site: str
        source_url: AnyHttpUrl
        posted_at: datetime
        scraped_at: datetime
        raw_categories: list[str] = Field(default_factory=list)
  • The @mcp.tool() decorator on the same line as 'def get_opportunity' registers the function as a tool with the FastMCP server.
    @mcp.tool()
Behavior3/5

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

No annotations provided, so the description carries full burden. It indicates a read operation ('Get full details'), but lacks details on auth, rate limits, or response complexity. Adequate for a simple retrieval.

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?

Single sentence, no wasted words. Efficient and front-loaded.

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 simplicity (1 param, output schema present), the description covers the essential purpose and method. Missing guidance on behavior like error handling or caching, but sufficient for typical 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?

With 0% schema description coverage, the description adds 'by ID' to clarify the single parameter, but does not provide further semantic detail beyond the schema.

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 verb 'Get', the resource 'full details for a single opportunity', and the method 'by ID'. It distinguishes from sibling tools like 'list_latest' and 'search_opportunities'.

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 implies usage when needing details of a specific opportunity, but provides no explicit when-to-use or alternatives. No guidance on when not to use this tool.

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