Skip to main content
Glama
perforce

Perforce P4 MCP Server

Official
by perforce

query_files

Retrieve file content, history, diffs, annotations, or search and grep Perforce files by name or content using depot or local paths.

Instructions

Get file content, history, info, diff, annotations, search by name, grep by content (READ permission)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diff2NoUse p4 diff2 for depot-to-depot diff, false for mixed diff
file2NoSecond file path - required for diff action
actionYesFile query action, metadata includes extra information like optional attributes and file size
patternNoSearch or grep pattern - required for search and grep actions
file_pathYesPrimary file path - required for all actions
max_resultsNoMaximum number of results to return. Bounds history/search/grep and also caps fstat info/metadata via 'p4 fstat -m N'. Omit for unbounded info/metadata results.
case_insensitiveNoCase-insensitive matching for grep action

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

With no annotations, the description bears the burden of disclosing behavior. It mentions 'READ permission' but fails to state what happens if the file does not exist, whether the tool is destructive, rate limits, or other side effects. The listed actions imply read-only, but no further traits are disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that packs multiple actions and permissions. While concise, it lacks structure (e.g., bullet points) and front-loads the most important information. It is not overly verbose, but could be better organized for quick scanning by an AI agent.

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

Completeness2/5

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

Given the tool's complexity (7 parameters, 8 actions, enums) and the presence of an output schema, the description should provide richer context like action-specific behavior, error handling, or examples. It does not explain how to choose among actions or how parameters interact (e.g., file2 for diff). This leaves gaps in completeness.

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 baseline is 3. The tool description adds minimal value beyond the schema: it lists actions and notes permissions, but does not clarify parameter relationships or usage nuances that the schema already covers. For instance, the schema already describes max_results bounding and file_path examples.

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 retrieves file content, history, info, diff, annotations, and performs search by name and grep by content. It lists distinct actions under a single verb 'Get', making the purpose specific. Sibling tools like modify_files or query_streams have different resources or operations, so this tool is well-distinguished.

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

Usage Guidelines2/5

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

The description does not provide guidance on when to use this tool versus alternatives (e.g., query_files vs query_changelists) or among its own actions. There are no explicit when-to-use or when-not-to-use instructions, and no exclusions or prerequisites mentioned.

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/perforce/p4mcp-server'

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