Skip to main content
Glama
Pharaoh - Your AI breaks things it can't see

Pharaoh - Your AI breaks things it can't see

by Pharaoh-so

Search Functions

search_functions
Read-only

Find functions by name or concept across a codebase to check if a helper already exists or locate where behavior like retry or validation is implemented.

Instructions

Find functions by name or concept across the whole codebase.

CALL THIS WHEN: • Checking whether a function, helper or utility already exists • Finding where something is implemented (e.g. "retry", "validate", "notify")

RETURNS: Matching functions with file path, line range, module, signature, export status and complexity. Matches name parts (camelCase, snake_case) and file paths, not comments; test code ranks last. SCREAMING_SNAKE queries, and queries no function matches, return matching constants with up to 80 characters of each value.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo": "<repo>",
      "query": "<query>"
    },
    "name": "search_functions"
  }
}

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)
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. Changed7 schema fields changedv0.1.3
    • changedInput schema / properties / limit / description
      Previous value: -"Max results (default 20, max 50)"New value: +"Max results (default 20)"
    • addedInput schema / properties / limit / maximum
      Added value: +50
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / offset / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / offset / minimum
      Added value: +0
    • changedInput schema / properties / offset / type
      Previous value: -"number"New value: +"integer"
  2. 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"
      +]
  3. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnly/non-destructive/closed-world, and the description still adds substantial behavior: the returned field set (path, line range, module, signature, export status, complexity), the matching rules (camelCase/snake_case name parts and file paths, comments excluded), test-code ranking, and the fallback that SCREAMING_SNAKE or zero-match queries return constants with up to 80 chars of value.

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 with a one-line purpose, then a labeled usage block and a labeled RETURNS block. Every sentence carries operational information — even the constant-fallback edge case is a real behavior an agent would otherwise misread as an empty result.

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?

With seven parameters and no output schema, the description correctly takes on return-value disclosure and matching semantics, so an agent can call it and interpret results without opening the schema. It omits pagination guidance (limit/offset interplay) and how `repo` scoping constrains the search, both of which the schema documents but the description could reinforce.

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?

Schema coverage is 100%, so the baseline is 3, and the description earns above it by explaining how `query` is actually interpreted (name-part splitting, case-style handling, file-path matching, constants fallback) rather than restating "Function name or part of one." The file/module/limit/offset/exported_only filters are left entirely to the schema, which is acceptable given full coverage.

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?

States a specific verb and resource with scope: "Find functions by name or concept across the whole codebase." The codebase-wide scope implicitly contrasts with module-scoped siblings like get_module_context, but no sibling is named, so an agent must infer the routing rather than read it.

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?

A dedicated "CALL THIS WHEN" block gives two concrete scenarios (duplicate-checking before writing, locating an implementation by keyword), which is clear usage context. It stops short of exclusions or naming alternatives such as get_codebase_map or get_unused_code, so it is not a full when/when-not/alternative specification.

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