Skip to main content
Glama

recommend_for_project

Given a project description, identifies the appropriate MCP servers and explains why they are recommended.

Instructions

Given a project description, recommend the top MCP servers to install and explain why each one fits. Example: "Python FastAPI backend with PostgreSQL and JWT auth"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The recommend_for_project function is the actual tool handler. It is registered with FastMCP via @mcp.tool() decorator, takes a project description string, ensures the index is built, calls find_similar() for semantic search, and formats results using _format_results().
    @mcp.tool()
    def recommend_for_project(description: str) -> str:
        """
        Given a project description, recommend the top MCP servers to install and explain why each one fits.
        Example: "Python FastAPI backend with PostgreSQL and JWT auth"
        """
        try:
            _ensure_index()
            results = find_similar(description, top_k=5)
            header = f"## Recommended MCP servers for: {description}\n\n"
            return header + _format_results(results, description)
        except Exception as e:
            return _error_response("generating recommendations", e)
  • The input schema is a single string parameter 'description' (no type annotations beyond str). The output schema is a str (formatted Markdown). FastMCP infers the schema automatically from the function signature.
    def recommend_for_project(description: str) -> str:
  • The tool is registered with the FastMCP server using the @mcp.tool() decorator. The FastMCP instance is created on line 22: mcp = FastMCP("kothar")
    @mcp.tool()
  • _format_results is a helper function that formats the list of server recommendations into Markdown. It calls generate_rationale() from the search module to produce explanations for each server.
    def _format_results(results: list[dict], project_description: str) -> str:
        if not results:
            return "No matching MCP servers found. Try a more descriptive project description."
    
        lines = []
        for i, r in enumerate(results, 1):
            rationale = generate_rationale(r, project_description)
            lines.append(
                f"{i}. **{r['name']}**\n"
                f"   {r['url']}\n"
                f"   {rationale}\n"
            )
        return "\n".join(lines)
  • find_similar is the core search function called by recommend_for_project. It embeds the query, runs a cosine similarity search against the DuckDB index, and returns the top_k results with an adaptive fallback.
    def find_similar(
        query: str,
        top_k: int = 10,
        exclude: list[str] | None = None,
        min_score: float = DEFAULT_MIN_SCORE,
    ) -> list[dict]:
        """
        Return top_k servers most semantically similar to query.
        Each result: {name, url, description, category, score}
        """
        model = _get_model()
        query_emb = _encode_query(model, query)
    
        excluded_lower = {n.lower() for n in (exclude or [])}
    
        con = get_connection()
        rows = con.execute(
            """
            SELECT name, description, url, category, score FROM (
                SELECT name, description, url, category,
                       array_cosine_similarity(embedding, ?::FLOAT[384]) AS score
                FROM servers
            )
            WHERE score >= ?
            ORDER BY score DESC
            """,
            [query_emb, min_score],
        ).fetchall()
        con.close()
    
        results = []
        for name, desc, url, cat, score in rows:
            name_lower = name.lower()
            short_name = name_lower.split("/")[-1]
            if any(
                e == name_lower or e == short_name or e in name_lower
                for e in excluded_lower
            ):
                continue
            results.append(
                {
                    "name": name,
                    "url": url,
                    "description": desc,
                    "category": cat,
                    "score": float(score),
                }
            )
            if len(results) >= top_k:
                break
    
        # Adaptive fallback: if nothing cleared the threshold, return the closest
        # matches below it so callers never silently get zero results.
        if not results and min_score > 0:
            return find_similar(query, top_k=top_k, exclude=exclude, min_score=0.0)
    
        return results
Behavior3/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. It implies a read-like recommendation behavior but does not disclose details like whether it modifies state, requires authentication, or has limitations on input length.

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 extremely concise with two sentences and an example, front-loading the core purpose. Every sentence 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 the existence of an output schema, the description does not need to detail return values. It covers what the tool does and gives an example, but could mention that it returns a list of servers with explanations. The hint 'top' could be clarified.

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 0% coverage, so the description must add meaning. It specifies that the parameter is a 'project description' and provides an example, which clarifies the expected format beyond the bare 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 tool's function: given a project description, it recommends MCP servers and explains why. It distinguishes from siblings like 'recommend_for_goal' by specifying the input is a project description, not a goal.

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

Usage Guidelines4/5

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

The description provides clear context for when to use (when you have a project description) with an example, but does not mention when not to use or explicitly contrast with sibling tools.

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/yahiaklk/kothar'

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