Skip to main content
Glama
sifter-ai

sifter-mcp

Official

find_records

Retrieve records from a sift using a MongoDB-subset filter. Supports sorting, limiting, and pagination via cursor.

Instructions

Filter records with structured criteria (no LLM roundtrip).

Args:
    sift_id: The sift identifier
    filter: Mongo-subset filter dict e.g. {"total": {"$gt": 1000}}
    sort: Optional sort spec e.g. [["date", -1]]
    limit: Max records to return (default 50)
    cursor: Opaque pagination cursor from a previous call

Returns:
    {"records": [...], "next_cursor": "..." | null}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sift_idYes
filterYes
sortNo
limitNo
cursorNo

Implementation Reference

  • MCP tool handler for 'find_records'. Uses @mcp.tool() decorator. Accepts sift_id, filter dict, optional sort, limit (default 50, max 200), and cursor for pagination. Calls client.get_sift().find() and returns records, next_cursor, and total.
    @mcp.tool()
    async def find_records(
        sift_id: str,
        filter: dict,
        sort: list = None,
        limit: int = 50,
        cursor: str = "",
    ) -> dict:
        """Filter records with structured criteria (no LLM roundtrip).
    
        Args:
            sift_id: The sift identifier
            filter: Mongo-subset filter dict e.g. {"total": {"$gt": 1000}}
            sort: Optional sort spec e.g. [["date", -1]]
            limit: Max records to return (default 50)
            cursor: Opaque pagination cursor from a previous call
    
        Returns:
            {"records": [...], "next_cursor": "..." | null}
        """
        async with _get_client() as client:
            handle = await client.get_sift(sift_id)
            page = await handle.find(
                filter=filter,
                sort=sort or None,
                limit=min(limit, 200),
                cursor=cursor or None,
            )
        return {"records": page.items, "next_cursor": page.next_cursor, "total": page.total}
  • OpenAI-compatible tool schema for 'find_records' used by LLM agent tool-calling. Defines JSON schema with sift_id, filter (MongoDB-style), and optional limit parameters.
        {
            "type": "function",
            "function": {
                "name": "find_records",
                "description": "Filter records in a sift using structured criteria (no LLM round-trip). Field names map to extracted_data keys.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "sift_id": {"type": "string", "description": "The sift identifier"},
                        "filter": {
                            "type": "object",
                            "description": 'MongoDB-style filter on extracted fields, e.g. {"amount": {"$gt": 1000}}',
                        },
                        "limit": {"type": "integer", "description": "Max records (default 50, max 200)"},
                    },
                    "required": ["sift_id", "filter"],
                },
            },
        },
    ]
  • Agent tool runner dispatch for 'find_records'. Builds a MongoDB $match pipeline on extracted_data fields with configurable limit (default 50, max 200), then calls execute_aggregation.
    if name == "find_records":
        limit = min(args.get("limit", 50), 200)
        raw_filter = args.get("filter", {})
        mongo_filter = {f"extracted_data.{k}": v for k, v in raw_filter.items()}
        pipeline = [{"$match": mongo_filter}, {"$limit": limit}]
        results = await self.results_svc.execute_aggregation(args["sift_id"], pipeline)
        return {"results": results, "count": len(results)}
  • Zapier integration search definition for 'find_records'. Registered in the 'searches' export at line 353. Defines input fields (sift_id, filter JSON, limit) and performs HTTP GET against the API.
    const searchFindRecords = {
      key: "find_records",
      noun: "Record",
      display: {
        label: "Find Records",
        description: "Search records in a sift.",
      },
      operation: {
        inputFields: [
          { key: "sift_id", label: "Sift", dynamic: "sift_choices.id.name", required: true },
          { key: "filter", label: "Filter (JSON)", required: false, helpText: 'e.g. {"amount": {"$gt": 100}}' },
          { key: "limit", label: "Limit", required: false, default: "10" },
        ],
        perform: async (z, bundle) => {
          const params = new URLSearchParams({ limit: bundle.inputData.limit || "10" });
          if (bundle.inputData.filter) params.set("filter", bundle.inputData.filter);
          const resp = await z.request({
            url: `${apiUrl(bundle)}/api/sifts/${bundle.inputData.sift_id}/records?${params}`,
            headers: headers(bundle),
          });
          return (resp.data.items || []);
        },
        sample: { id: "sample-record-id", extracted_data: {} },
      },
    };
  • Zapier searches registration block where 'find_records' is registered as a search action via the key 'searchFindRecords.key'.
    searches: {
      [searchFindRecords.key]: searchFindRecords,
      [searchGetRecord.key]: searchGetRecord,
    },
Behavior3/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. It explains the filtering behavior and return format, but does not disclose side effects, permissions, or performance considerations.

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 concise: a one-line summary followed by a clear Args/Returns structure. Every sentence adds value with no redundancy.

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 no output schema, the description adequately covers return format and pagination. Parameter explanations are sufficient for the tool's complexity (5 params, nested objects), though error handling is omitted.

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

Parameters4/5

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

With 0% schema coverage, the description adds significant meaning by detailing each parameter with examples (e.g., filter dict, sort spec, pagination cursor), going beyond type-only schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it filters records with structured criteria and explicitly distinguishes it from LLM roundtrip approaches, giving a specific verb-resource pairing.

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 for structured filtering (no LLM), but does not explicitly state when to use this tool versus alternatives like query_sift or list_records. No exclusions or direct sibling differentiation.

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/sifter-ai/sifter'

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