Skip to main content
Glama

filter_rows

Filter data rows using flexible conditions with support for null values, text matching, and logical combinations to extract specific subsets from datasets.

Instructions

Filter rows using flexible conditions: comprehensive null value and text matching support.

Provides powerful filtering capabilities optimized for AI-driven data analysis. Supports multiple operators, logical combinations, and comprehensive null value handling.

Examples: # Numeric filtering filter_rows(ctx, [{"column": "age", "operator": ">", "value": 25}])

# Text filtering with null handling
filter_rows(ctx, [
    {"column": "name", "operator": "contains", "value": "Smith"},
    {"column": "email", "operator": "is_not_null"}
], mode="and")

# Multiple conditions with OR logic
filter_rows(ctx, [
    {"column": "status", "operator": "==", "value": "active"},
    {"column": "priority", "operator": "==", "value": "high"}
], mode="or")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionsYesList of filter conditions with column, operator, and value
modeNoLogic for combining conditions (and/or)and

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successNoWhether operation completed successfully
rows_afterYesRow count after filtering
rows_beforeYesRow count before filtering
rows_filteredYesNumber of rows removed by filter
conditions_appliedYesNumber of filter conditions applied
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses behavioral traits like 'flexible conditions,' 'multiple operators,' 'logical combinations,' and 'comprehensive null value handling,' which are useful beyond basic filtering. However, it doesn't mention performance implications, error handling, or what happens with invalid conditions. The examples add practical context but leave gaps in full behavioral understanding.

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 well-structured, starting with a clear purpose statement, followed by supporting details and practical examples. It's appropriately sized for a complex tool, with each sentence adding value—no redundant information. However, the phrase 'optimized for AI-driven data analysis' is somewhat vague and could be trimmed without loss of clarity.

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 the tool's complexity (flexible filtering with multiple parameters), the description is reasonably complete. It covers key capabilities like operators and logic modes, supported by examples. With an output schema present (as indicated by context signals), the description doesn't need to explain return values. However, it could better address error cases or limitations to be fully comprehensive.

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, thoroughly documenting 'conditions' and 'mode' with enums and examples. The description adds minimal value beyond this, as it doesn't explain parameter semantics like the structure of 'conditions' beyond what's in the schema. The examples illustrate usage but don't provide new semantic insights. With high schema coverage, 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 as 'Filter rows using flexible conditions' with specific mention of 'null value and text matching support.' It distinguishes itself from siblings like 'select_columns' or 'get_row_data' by emphasizing conditional filtering rather than simple selection or retrieval. However, it doesn't explicitly differentiate from tools like 'find_cells_with_value' or 'detect_outliers' that might also involve filtering logic.

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 through examples showing numeric filtering, text filtering with null handling, and logical combinations, suggesting it's for data analysis tasks. However, it lacks explicit guidance on when to use this tool versus alternatives like 'find_cells_with_value' or 'detect_outliers,' and doesn't mention prerequisites such as needing loaded data. The examples provide context but no clear 'when-not' scenarios.

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/jonpspri/databeak'

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