Skip to main content
Glama
Pharaoh-so

Pharaoh - Your AI breaks things it can't see

search_functions

Read-only

Search existing functions across the codebase to prevent duplication before writing new code, ensuring you reuse implementations instead of recreating them.

Instructions

Check if functionality already exists BEFORE writing any new function, utility, or helper.

CALL THIS WHEN: • You're about to create a new function — search first to prevent duplicates • You need to find where a concept is implemented (e.g., 'notify', 'validate', 'parse') • You're looking for the right function to import instead of reimplementing • A task says 'add X functionality' — verify X doesn't already exist

RETURNS: Matching functions with file paths, line numbers, module, export status, async flag, complexity scores, and full signatures. Searches all functions across the entire codebase.

EXAMPLES: • "Is there already a function that sends Slack notifications?" • "What validation utilities exist?" • "Where is email formatting handled?" • "Does a retry wrapper already exist somewhere?"

WHY NOT JUST READ FILES: grep only finds exact string matches and misses re-exports, aliases, and barrel-file indirection. This searches the full resolved dependency graph — if it exists anywhere in the codebase, this finds it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With readOnlyHint:true already indicating safe read operations, the description adds valuable return value disclosure: 'Matching functions with file paths, line numbers, module, export status, async flag, complexity scores, and full signatures.' It also clarifies scope: 'Searches all functions across the entire codebase' and 'full resolved dependency graph.' Could mention performance characteristics or caching behavior for a perfect 5.

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?

Well-structured with clear headers (CALL THIS WHEN, RETURNS, EXAMPLES, WHY NOT JUST READ FILES) making it scannable despite length. Every section earns its place—examples are concrete, justification vs grep is distinctive context. Slight deduction only because the length is substantial for an MCP description, though justified by the zero-parameter nature requiring clear usage guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema exists, the description comprehensively documents return values (file paths, line numbers, signatures, etc.). For a zero-parameter, read-only search tool, it adequately covers scope (entire codebase), behavior (dependency graph resolution), and use cases. No gaps identified given the tool's simplicity and annotation coverage.

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?

Input schema contains 0 parameters (empty object), triggering the baseline score of 4 per rubric ('0 params = baseline 4'). Description appropriately does not invent parameter documentation where none exist, and the provided examples demonstrate usage patterns without implying non-existent parameters.

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?

Excellent specificity: 'Check if functionality already exists BEFORE writing any new function' provides clear verb (search/check) and resource (functions). It distinguishes itself from siblings like get_codebase_map (structural overview) and query_dependencies (dependency graph) by focusing specifically on finding existing implementations to prevent duplicate code.

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

Usage Guidelines5/5

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

Explicit 'CALL THIS WHEN:' section lists 4 specific trigger conditions (before creating functions, finding implementations, importing vs reimplementing, verifying existing functionality). It also includes 'WHY NOT JUST READ FILES' contrasting against grep alternatives, providing clear guidance on when to prefer this tool over simple file reading.

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/Pharaoh-so/pharaoh'

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