Skip to main content
Glama

surface

Read-only

Finds and returns relevant memories for a file during editing, showing paths, titles, types, priorities, and match details while skipping memories already shown in the session.

Instructions

Memories (not constraints) about a file: listed in its files, or mentioned in the body.

Returns JSON {"file", "memories": [{"path", "title", "type", "priority", "match"}]}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "surface"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoFile being edited: absolute or relative to the project. Empty (with no relative_path) returns an empty result.
limitNoMaximum memories, 1-50.
projectNoProject; defaults to --project.
sessionNoHooks pass ${session_id}: a memory already shown by surface in this session is not repeated.
hook_eventNoOnly for Claude Code hooks: ${hook_event_name}. Omit otherwise.
project_dirNoAbsolute project directory (hooks pass ${cwd}); used to relativize file.
relative_pathNoSerena edits pass relative_path instead of file; used when file is empty.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.16.0

TDQS

A3.5/5.0
Behavior3/5

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

readOnlyHint=true already tells the agent this is a safe read, so the description does not need to establish that. It adds the return envelope shape, which is genuinely useful given no output schema exists, plus the memories-vs-constraints scoping. It does not mention the session-level deduplication behavior or the empty-result condition, both of which live only in the schema.

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?

Two sentences, no filler, with the scope qualifier front-loaded before the return shape. The second sentence is a compact and useful schema substitute. Minor deduction because the first sentence is compressed to the point of ambiguity ('listed in its files').

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?

Seven optional parameters with full schema coverage and no output schema, and the description compensates for the missing output schema by spelling out the returned JSON keys. What remains thin — deduplication and empty-result semantics — is covered in the schema, so an agent has enough to call this correctly.

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 the parameters are already fully documented and the baseline is 3. The description reinforces that results are keyed to a file but adds no format, precedence, or interaction detail beyond the schema — notably it says nothing about how file, relative_path, and project_dir combine.

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?

The description names the resource (memories about a file) and the two discovery routes — listed in the file's files, or mentioned in the body — and explicitly excludes constraints, which differentiates it from the sibling tool of that name. The verb is implicit in the tool name 'surface' rather than stated, and 'listed in its files' is elliptical enough to require a second read, which keeps it out of the top band.

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?

There is real differentiation from the 'constraints' sibling, which is the main routing decision an agent faces. However, there is no explicit when-to-use or when-not-to-use statement, and nothing tells the agent how this relates to the other retrieval siblings such as search or context; the guidance is implied by the scope sentence rather than stated.

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