Skip to main content
Glama
FlowLLM-AI

Finance MCP

by FlowLLM-AI

mock_search

Retrieve financial information from the internet by searching with specific keywords. Supports financial research and analysis workflows.

Instructions

Use search keywords to retrieve relevant information from the internet. If you have multiple keywords, please call this tool separately for each one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYessearch keyword

Implementation Reference

  • The async_execute method implements the handler logic for the mock_search tool, using an LLM to generate mock search results in JSON format based on the query.
    async def async_execute(self):
        """Generate mock search results using an LLM.
    
        The method builds a small conversation where the system message
        instructs the model to return JSON-formatted search results, and
        the user message contains the formatted query. The JSON
        structure is then extracted and pretty-printed.
        """
    
        query: str = self.input_dict["query"]
        if not query:
            answer = "query is empty, no results found."
            logger.warning(answer)
            self.set_output(answer)
            return
    
        messages = [
            Message(
                role=Role.SYSTEM,
                content="You are a helpful assistant that generates realistic search results in JSON format.",
            ),
            Message(
                role=Role.USER,
                content=self.prompt_format(
                    "mock_search_op_prompt",
                    query=query,
                    num_results=random.randint(0, 5),
                ),
            ),
        ]
    
        logger.info(f"messages={messages}")
    
        def callback_fn(message: Message):
            return extract_content(message.content, "json")
    
        search_results: str = await self.llm.achat(messages=messages, callback_fn=callback_fn)
        self.set_output(json.dumps(search_results, ensure_ascii=False, indent=2))
  • The build_tool_call method defines the input schema and description for the mock_search tool.
    def build_tool_call(self) -> ToolCall:
        """Build the tool call schema describing the mock search tool.
    
        Returns:
            ToolCall: Definition containing description and input schema
            for the ``query`` parameter.
        """
    
        return ToolCall(
            **{
                "description": self.get_prompt("tool_description"),
                "input_schema": {
                    "query": {
                        "type": "string",
                        "description": "search keyword",
                        "required": True,
                    },
                },
            },
        )
  • The MockSearchOp class is registered via @C.register_op(), which registers it as the mock_search tool in the MCP framework.
    @C.register_op()
    class MockSearchOp(BaseAsyncToolOp):
        """Asynchronous mock search tool that generates LLM-based results."""
Behavior2/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 of behavioral disclosure. It mentions that the tool retrieves information from the internet but doesn't specify behavioral traits such as rate limits, authentication needs, response format, or error handling. For a search tool with no annotation coverage, this leaves significant gaps in understanding how it operates beyond the basic purpose.

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 concise with two sentences that directly address the tool's function and a usage note. It's front-loaded with the core purpose, and the second sentence adds necessary operational guidance without redundancy. However, it could be slightly more structured by explicitly separating purpose from instructions, but overall it's efficient with minimal waste.

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

Completeness2/5

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

Given the complexity of a search tool, no annotations, and no output schema, the description is incomplete. It lacks details on what the tool returns (e.g., format, pagination), error conditions, or how it differs from sibling tools. While it states the basic purpose, it doesn't provide enough context for an agent to use it effectively without trial and error, especially compared to other search-related tools in the sibling list.

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?

The input schema has 100% description coverage, with the 'query' parameter documented as 'search keyword'. The description adds minimal value by restating 'search keywords' but doesn't provide additional semantics like examples, formatting tips, or constraints beyond what the schema already covers. Given the high schema coverage, a baseline score of 3 is appropriate as the description doesn't compensate with extra insights.

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's purpose: 'retrieve relevant information from the internet' using 'search keywords'. It specifies the verb ('retrieve') and resource ('information from the internet'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'dashscope_search' or 'tavily_search', which appear to be similar search tools.

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 provides some usage guidance by stating 'If you have multiple keywords, please call this tool separately for each one,' which implies a constraint on batching. However, it doesn't explain when to use this tool versus alternatives like 'dashscope_search' or 'tavily_search', nor does it mention any prerequisites or exclusions. The guidance is limited to operational details without broader context.

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/FlowLLM-AI/finance-mcp'

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