Skip to main content
Glama
mimeCam

DevBrain

by mimeCam

retrieve_knowledge

Query DevBrain to extract relevant developer knowledge, articles, and resources. Use tags like 'ios' or 'react-native' to refine search results and access title, description, and URLs for further reading.

Instructions

Queries DevBrain (aka developers brain` system) and returns relevant information.

Args: query: The question or ask to query for knowledge. tags: Optional comma-separated list of tags (keywords) to filter or ground the search. (e.g.: ios, ios,SwiftUI, react-native, web, web,react, fullstack,react-native,flutter). Do not provide more than 3 words.

Returns: str: Helpful knowledge and context information from DevBrain (articles include title, short description and a URL to the full article to read it later).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
tagsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'retrieve_knowledge' tool. It validates the API token, constructs a POST request to the DevBrain API with the query and optional tags, and returns the response text or an error message.
    def retrieve_knowledge(query: str, tags: str | None = None) -> str:
        """Queries DevBrain (aka `developer`s brain` system) and returns relevant information.
    
        Args:
            query: The question or ask to query for knowledge.
            tags: Optional comma-separated list of tags (keywords) to filter or ground the search. (e.g.: `ios`, `ios,SwiftUI`, `react-native`, `web`, `web,react`, `fullstack,react-native,flutter`). Do not provide more than 3 words.
    
        Returns:
            str: Helpful knowledge and context information from DevBrain (articles include title, short description and a URL to the full article to read it later).
        """
    
        token_error = _enforce_token()
        if token_error:
            return token_error
    
        url = f"{api_host_base}/newsletter/find"
        headers = {
            "authorization": f"Bearer {_token}",
            "content-type": "application/json",
        }
        data = {"q": query}
        if tags:
            data["tags"] = tags
        try:
            response = requests.post(url, headers=headers, json=data)
            response.raise_for_status()  # Raise an HTTPError for bad responses (4xx or 5xx)
            return response.text
        except requests.exceptions.RequestException:
            return "No related knowledge at this time for this search query. API error occurred - DevBrain knowledge base service is temporarily unavailable."
  • The @mcp_server.tool decorator registers the retrieve_knowledge function as an MCP tool.
    @mcp_server.tool
  • Helper function used by retrieve_knowledge to ensure the API token is set, retrieving it from environment if necessary.
    def _enforce_token() -> str | None:
        global _token
        if _token is None:
            _token = os.getenv("API_TOKEN")
            if _token is None:
                return "Token not set. You need to set `API_TOKEN` environment variable."
        return None
  • The function signature and docstring define the input schema (query: str required, tags: str|None optional) and output (str), used by FastMCP for tool schema.
    def retrieve_knowledge(query: str, tags: str | None = None) -> str:
        """Queries DevBrain (aka `developer`s brain` system) and returns relevant information.
    
        Args:
            query: The question or ask to query for knowledge.
            tags: Optional comma-separated list of tags (keywords) to filter or ground the search. (e.g.: `ios`, `ios,SwiftUI`, `react-native`, `web`, `web,react`, `fullstack,react-native,flutter`). Do not provide more than 3 words.
    
        Returns:
            str: Helpful knowledge and context information from DevBrain (articles include title, short description and a URL to the full article to read it later).
        """
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the system returns 'relevant information' and describes the output format, but doesn't address important behavioral aspects like rate limits, authentication requirements, error conditions, response time expectations, or whether queries are cached. The description adds some value about the return format but leaves significant behavioral gaps.

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?

The description is well-structured with clear sections (Args, Returns) and front-loads the core purpose. The parameter explanations are detailed but necessary given the schema coverage gap. Some redundancy exists in explaining DevBrain as both 'developer's brain system' and the source of articles, but overall the description earns its length with valuable 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 has an output schema (which covers return values), the description appropriately focuses on purpose and parameters rather than return format. It provides good parameter semantics despite 0% schema coverage. For a query tool with a sibling, it could benefit from more explicit differentiation and behavioral context, but it's reasonably complete for its complexity level.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by providing detailed semantic information about both parameters. It explains 'query' as 'the question or ask to query for knowledge' and 'tags' as 'optional comma-separated list of tags to filter or ground the search', including specific examples and the constraint 'Do not provide more than 3 words'. This adds substantial meaning beyond the bare schema.

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 tool 'queries DevBrain and returns relevant information', specifying both the action (queries) and resource (DevBrain system). It distinguishes from the sibling 'read_full_article' by focusing on querying rather than reading full articles. However, it doesn't fully explain what DevBrain is beyond 'developer's brain system', leaving some ambiguity about the knowledge domain.

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 through the mention of 'queries DevBrain' and the sibling tool name, suggesting this is for initial knowledge retrieval while 'read_full_article' is for deeper reading. However, it lacks explicit guidance on when to choose this tool versus alternatives, and doesn't mention prerequisites, constraints, or specific scenarios where this tool is most appropriate.

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

Related 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/mimeCam/mcp-devbrain-stdio'

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