Skip to main content
Glama
FlowLLM-AI

Finance MCP

by FlowLLM-AI

dashscope_search

Search the internet for financial information to support research and analysis. Retrieve relevant data for stocks, funds, and market investigations using specific keywords.

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 core handler function that performs the web search using Dashscope API, handles caching, processes search results and response.
    async def async_execute(self):
        """Execute a Dashscope web search for the given query.
    
        The method prepares the user query (optionally using a role
        prompt), calls the Dashscope generation API with search enabled,
        and returns the natural-language answer produced by the model.
        """
    
        query: str = self.input_dict["query"]
    
        if self.enable_cache:
            cached_result = self.cache.load(query)
            if cached_result:
                self.set_output(cached_result["response_content"])
                return
    
        if self.enable_role_prompt:
            user_query = self.prompt_format(prompt_name="role_prompt", query=query)
        else:
            user_query = query
        logger.info(f"user_query={user_query}")
        messages: list = [{"role": "user", "content": user_query}]
    
        import dashscope
    
        response = await dashscope.AioGeneration.call(
            api_key=self.api_key,
            model=self.model,
            messages=messages,
            enable_search=True,  # Enable web search
            search_options={
                "forced_search": True,  # Force web search
                "enable_source": True,  # Include search source information
                "enable_citation": False,  # Enable citation markers
                "search_strategy": self.search_strategy,  # Search strategy
            },
            result_format="message",
        )
    
        search_results = []
        response_content = ""
    
        if hasattr(response, "output") and response.output:
            if hasattr(response.output, "search_info") and response.output.search_info:
                search_results = response.output.search_info.get("search_results", [])
    
            if hasattr(response.output, "choices") and response.output.choices and len(response.output.choices) > 0:
                response_content = response.output.choices[0].message.content
    
        final_result = {
            "query": query,
            "search_results": search_results,
            "response_content": response_content,
            "model": self.model,
            "search_strategy": self.search_strategy,
        }
    
        if self.enable_cache:
            self.cache.save(query, final_result, expire_hours=self.cache_expire_hours)
    
        self.set_output(final_result["response_content"])
  • Defines the tool schema with a single required 'query' string input and description from prompt.
    def build_tool_call(self) -> ToolCall:
        """Build the tool call schema for the Dashscope search op."""
    
        return ToolCall(
            **{
                "description": self.get_prompt("tool_description"),
                "input_schema": {
                    "query": {
                        "type": "string",
                        "description": "search keyword",
                        "required": True,
                    },
                },
            },
        )
  • Registers the DashscopeSearchOp tool operation with the context registry (@C.register_op()). The tool is referred to as 'dashscope_search' in usage.
    @C.register_op()
    class DashscopeSearchOp(BaseAsyncToolOp):
        """A tool operation for performing web searches using Dashscope API.
    
        This operation enables LLM models to search the internet for information by
        providing search keywords. It supports various search strategies and can
        optionally use role prompts to enhance search queries.
        """
    
        file_path: str = __file__
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 retrieving information from the internet but doesn't cover important behavioral aspects like rate limits, authentication needs, result format, pagination, or error handling. For a search tool with no annotations, this leaves significant gaps in understanding how it behaves.

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 and well-structured: two sentences that directly address purpose and usage guidelines. Every sentence earns its place with no wasted words or redundancy.

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 an internet search tool with no annotations and no output schema, the description is insufficient. It doesn't explain what kind of information is returned, how results are formatted, whether there are limitations, or how it differs from sibling search tools. The description provides basic usage but lacks completeness for effective tool selection.

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 schema description coverage is 100%, with the single parameter 'query' documented as 'search keyword'. The description adds no additional parameter semantics beyond what the schema provides (it just repeats 'search keywords'). Since schema coverage is high, the baseline score of 3 is appropriate.

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 action (retrieve) and resource (internet information). However, it doesn't explicitly differentiate from sibling tools like 'tavily_search' or 'mock_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 Guidelines5/5

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

The description provides explicit usage guidance: 'If you have multiple keywords, please call this tool separately for each one.' This gives clear instructions on when and how to use the tool versus alternatives (like batching queries). No misleading guidance is present.

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