Skip to main content
Glama
xinrong-meng

My Finance MCP Server

query_financial_history

Search stored financial transactions using natural language queries to find relevant records and generate summaries with totals.

Instructions

Search through all stored financial data using semantic search.

Args:
    query: Search query string to find relevant transactions

Returns:
    Formatted summary of matching transactions with totals

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'query_financial_history' tool. It uses ChromaDB to perform semantic search on stored transactions based on the query, formats the results into a summary including total amount and recent transactions.
    @mcp.tool()
    def query_financial_history(query: str) -> str:
        """
        Search through all stored financial data using semantic search.
        
        Args:
            query: Search query string to find relevant transactions
        
        Returns:
            Formatted summary of matching transactions with totals
        """
        # Search ChromaDB
        results = collection.query(
            query_texts=[query],
            n_results=10
        )
        
        # Format results
        found_transactions = []
        if results['metadatas'][0]:
            for metadata in results['metadatas'][0]:
                found_transactions.append(metadata)
        
        # Create summary
        if found_transactions:
            df = pd.DataFrame(found_transactions)
            total_amount = df['amount'].sum() if 'amount' in df.columns else 0
            count = len(found_transactions)
            
            response = f"Found {count} relevant transactions.\n"
            response += f"Total amount: ${total_amount:.2f}\n\n"
            response += "Recent transactions:\n"
            
            for txn in found_transactions[:5]:
                response += f"- {txn.get('date')}: ${txn.get('amount'):.2f} - {txn.get('description')}\n"
                
        else:
            response = "No matching transactions found."
        
        return response
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'semantic search' which hints at intelligent matching beyond exact terms, but doesn't explain what 'all stored financial data' encompasses, whether there are rate limits, authentication requirements, or how results are formatted beyond 'formatted summary'. For a search tool with zero annotation coverage, this 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 appropriately concise with three sentences that each serve a purpose: stating the tool's function, describing the parameter, and explaining the return value. It's front-loaded with the core purpose and avoids unnecessary verbiage.

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

Completeness3/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 handles return values) and only one parameter, the description covers the basics: purpose, parameter role, and return type. However, as a search tool with no annotations, it lacks details on behavioral aspects like search scope, limitations, or error handling, making it minimally adequate but with clear gaps.

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 0%, so the description must compensate. It adds that the 'query' parameter is a 'Search query string to find relevant transactions', which provides basic semantic context beyond the schema's title 'Query'. However, it doesn't elaborate on query syntax, examples, or constraints, leaving the parameter only partially documented.

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 as 'Search through all stored financial data using semantic search' - this specifies the verb (search), resource (financial data), and method (semantic search). However, it doesn't explicitly differentiate from sibling tools like 'list_transactions' which might also retrieve financial data, leaving room for ambiguity about when to use semantic search versus listing.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'list_transactions' or 'store_transactions'. It doesn't mention scenarios where semantic search is preferred over other methods, nor does it specify prerequisites or exclusions for usage.

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/xinrong-meng/my-finance-mcp'

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