Skip to main content
Glama

find_replace

Replace text in Excel worksheets by specifying find and replacement strings, with support for regex, case matching, whole-cell matches, and formula search.

Instructions

Find and replace text across a worksheet.

Args: file_path: Path to workbook to modify. sheet_name: Worksheet name. find_text: Substring or pattern to find. replace_text: Replacement text. match_case: Case-sensitive search when True. match_entire_cell: Match entire cell contents exactly when True. search_formulas: Also search within formulas when True. regex: Treat find_text as a regular expression when True.

Returns: dict: {"count": int, "cells": ["A1", ...]} detailing replacements.

Notes: - Destructive: modifies cells in-place. - Consider returning per-cell before/after pairs for audit logging in high-risk contexts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regexNo
file_pathYes
find_textYes
match_caseNo
sheet_nameYes
replace_textYes
search_formulasNo
match_entire_cellNo
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It clearly warns 'Destructive: modifies cells in-place' and describes the return dict with count and cells. This discloses the key mutation behavior and result shape, though edge cases like no-match behavior are not covered.

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 a well-structured docstring with Args, Returns, and Notes sections. Every sentence serves a purpose; the note about audit logging adds useful context without unnecessary verbosity.

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?

For an 8-parameter write operation with no output schema, the description covers input semantics, return format, and destructive behavior. It could be more complete by mentioning what happens when no matches are found or how defaults affect behavior, but it adequately addresses core usage.

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

Parameters5/5

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

The description provides a one-line explanation for all 8 parameters in the Args section, adding semantic meaning beyond the input schema's names and titles. Boolean flags like match_case, search_formulas, and regex are explicitly explained.

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 tool's function: 'Find and replace text across a worksheet.' This is a specific verb+resource pairing that distinguishes it from sibling tools like write_cells or clear_range. The worksheet scope and replace operation are explicit.

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 find-and-replace operations and mentions it modifies cells in-place, but it does not explicitly state when to use this tool versus alternatives or provide any exclusion criteria. The audit-logging note is a caution, not usage guidance.

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/mbeps/excel-mcp'

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