Skip to main content
Glama
elcukro

bank-mcp

by elcukro

search_transactions

Find specific bank transactions by searching descriptions, merchant names, and references to identify payments or payees.

Instructions

Full-text search across transaction descriptions, merchant names, and references. Use for finding specific payments or payees.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch text — matched against description, merchant name, and reference.
connectionIdNo
dateFromNo
dateToNo
limitNoMax results. Default 50.

Implementation Reference

  • Main handler function that executes search_transactions logic. Fetches transactions using listTransactions for the specified date range/connection, then filters them locally by matching the query string (case-insensitive) against description, merchant name, and reference fields, applying the specified limit.
    export async function searchTransactions(
      args: z.infer<typeof searchTransactionsSchema>,
    ): Promise<unknown> {
      // Fetch all transactions for the date range, then filter locally
      const transactions = await listTransactions({
        connectionId: args.connectionId,
        dateFrom: args.dateFrom,
        dateTo: args.dateTo,
      });
    
      const q = args.query.toLowerCase();
      const limit = args.limit || 50;
    
      const matches = transactions.filter((t) => {
        const fields = [t.description, t.merchantName, t.reference].filter(Boolean);
        return fields.some((f) => f!.toLowerCase().includes(q));
      });
    
      return matches.slice(0, limit);
    }
  • Input schema for search_transactions tool using Zod. Defines required 'query' parameter (search text) and optional parameters: connectionId, dateFrom, dateTo, and limit (default 50).
    export const searchTransactionsSchema = z.object({
      query: z
        .string()
        .describe("Search text — matched against description, merchant name, and reference."),
      connectionId: z.string().optional(),
      dateFrom: z.string().optional(),
      dateTo: z.string().optional(),
      limit: z.number().optional().describe("Max results. Default 50."),
    });
  • src/server.ts:37-42 (registration)
    Tool registration in the TOOLS array. Defines the tool name 'search_transactions', description for full-text search across transactions, and maps to the searchTransactionsSchema for input validation.
    {
      name: "search_transactions",
      description:
        "Full-text search across transaction descriptions, merchant names, and references. Use for finding specific payments or payees.",
      inputSchema: z.toJSONSchema(searchTransactionsSchema),
    },
  • src/server.ts:63-64 (registration)
    Handler mapping in the handlers record that routes 'search_transactions' tool calls to the searchTransactions function with schema validation.
    search_transactions: (args) =>
      searchTransactions(searchTransactionsSchema.parse(args)),
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 the search scope but doesn't cover critical aspects like whether this is a read-only operation, potential rate limits, authentication needs, pagination behavior beyond the 'limit' parameter, or what happens with no results. This leaves significant gaps for a search tool.

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 appropriately sized with two concise sentences that are front-loaded with the main purpose. Every sentence earns its place by adding specific value without 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 a search tool with 5 parameters, low schema coverage (40%), no annotations, and no output schema, the description is incomplete. It doesn't explain the return format, error handling, or provide enough detail on parameter usage beyond the 'query', making it inadequate for full agent understanding.

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?

Schema description coverage is low at 40%, with only 'query' and 'limit' having descriptions. The description adds value by explaining what fields the 'query' parameter searches against ('description, merchant name, and reference'), which isn't in the schema. However, it doesn't compensate for the undocumented parameters like 'connectionId', 'dateFrom', and 'dateTo', leaving them ambiguous.

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 with specific verbs ('Full-text search') and resources ('transaction descriptions, merchant names, and references'), and distinguishes it from siblings by focusing on search functionality. However, it doesn't explicitly differentiate from 'list_transactions' which might also retrieve transactions.

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 implied usage guidance ('Use for finding specific payments or payees'), suggesting when to use it. However, it lacks explicit when-not-to-use scenarios or clear alternatives among siblings like 'list_transactions' or 'spending_summary'.

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/elcukro/bank-mcp'

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