Skip to main content
Glama
Pharaoh-so

Pharaoh - Your AI breaks things it can't see

by Pharaoh-so

search_functions

Read-only

Find functions by name or concept across a codebase to check for duplicates, locate implementations, and replace grep with alias-aware results.

Instructions

Find functions by name or concept across the whole codebase.

CALL THIS WHEN: • You're about to write a function, helper or utility: check it doesn't already exist • You need to know where something is implemented (e.g. "retry", "validate", "notify")

RETURNS: Matching functions with file path, line range, module, signature, export status and complexity.

USE INSTEAD OF: grep, which misses aliases and re-exports and includes comments.

Input Schema

NameRequiredDescriptionDefault
fileNoOnly this file (full path matches exactly, a file name as a substring)
repoYesRepository name — one of your connected repos.
limitNoMax results (default 20, max 50)
queryYesFunction name or part of one
moduleNoOnly this module
offsetNoResults to skip (default 0)
exported_onlyNoExported functions only (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.1.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / exported_only
      Added value: +{
      +  "description": "Exported functions only (default false)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / file
      Added value: +{
      +  "description": "Only this file (full path matches exactly, a file name as a substring)",
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Max results (default 20, max 50)",
      +  "type": "number"
      +}
    • addedInput schema / properties / module
      Added value: +{
      +  "description": "Only this module",
      +  "type": "string"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "description": "Results to skip (default 0)",
      +  "type": "number"
      +}
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "Function name or part of one",
      +  "maxLength": 500,
      +  "type": "string"
      +}
    • addedInput schema / properties / repo
      Added value: +{
      +  "description": "Repository name — one of your connected repos.",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "repo",
      +  "query"
      +]
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered; the description adds value beyond that by disclosing the exact return payload fields (file path, line range, module, signature, export status, complexity). It does not mention pagination/limit behavior or ranking/relevance ordering, which is the remaining gap for a search tool.

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?

Front-loaded one-line purpose followed by three short labeled blocks (when, returns, alternative). No filler sentences; every line adds decision-relevant information.

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?

With 7 parameters, no output schema, and only read-only annotations, the description compensates well: it explains the return shape, the intent, and the alternative tool. Nothing an agent needs to select or invoke it correctly appears to be missing.

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 100%, so every parameter (file, repo, limit, query, module, offset, exported_only) is already documented in structured form; the description only loosely implies 'name or concept' matching for query. Baseline 3 is appropriate since the schema carries the parameter burden.

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?

States a specific verb and resource ('Find functions') with explicit scope ('by name or concept across the whole codebase'), and the returns line clarifies it's a semantic/keyword search rather than a structural map like get_codebase_map. An agent can distinguish it from grep and from the sibling recon tools without opening a schema.

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?

The 'CALL THIS WHEN' block gives two concrete triggering scenarios (pre-writing a helper, locating an implementation) and names the concrete alternative to avoid ('USE INSTEAD OF: grep'), including the reason grep fails (misses aliases and re-exports, includes comments). That is explicit when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.