Skip to main content
Glama

select_dtypes

Keep only DataFrame columns matching specified data types. Drop non-matching columns to clean data for modeling.

Instructions

Keep only columns matching specified dtypes. Drops non-matching columns. Filter columns by type. Use include=['number'] before modeling to keep only numeric features. Example: select_dtypes(include=["number"]) — keeps only numeric columns. Example: select_dtypes(exclude=["object"]) — drops string columns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
df_nameNo
excludeNo
includeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the burden of disclosing behavior. It explicitly mentions the destructive action 'Drops non-matching columns' and clarifies the effect of the include/exclude parameters. It does not mention whether the operation modifies the original dataframe or returns a new one, but the core behavior is transparent.

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 mostly efficient, front-loading the purpose. It has some redundancy ('Keep only columns' vs 'Filter columns by type') and repeats examples twice. It is not overly long and every sentence adds some value, but tightening it would improve conciseness.

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 moderate complexity and the existence of an output schema (which reduces the need to explain returns), the description covers the main use cases, provides examples, and mentions the modeling context. It lacks details on df_name and edge cases, but overall it is sufficiently complete for typical usage.

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 0%, so the description must compensate. It explains include and exclude via examples, but df_name is not mentioned at all. Also, it does not enumerate valid dtype strings or handle the case when both include and exclude are set. Thus, it partially compensates but lacks full parameter documentation.

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 the specific verb+resource: 'Keep only columns matching specified dtypes' and 'Drops non-matching columns.' This distinctively separates it from sibling tools like drop_columns (which removes by name) or convert_dtype (which changes types). The purpose is immediately unambiguous.

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

Usage Guidelines4/5

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

It provides a concrete usage context: 'Use include=['number'] before modeling to keep only numeric features.' This implies when the tool is useful. It also gives examples for include and exclude. However, it does not explicitly name alternatives or state when not to use it, which would make it a 5.

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/AstyanM/mcp-data-science'

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