Skip to main content
Glama

Pack project context

pack_context
Read-only

Builds multi-file project context within a token budget, selecting tree, content, or both so AI agents can analyze large codebases without exceeding limits.

Instructions

Builds multi-file project context. Use it after get_tree, search_project, or analyze; use get_file for one file. Returns inline untrusted project data, or pack_id plus a preview above 50,000 characters for read_pack. Key parameters: detail, view=tree|content|tree-content, format, rank, focus, max_tokens, git_scope, and detail_by_pattern. detail=full still transforms content. expand_related adds resolved selected neighbours. focus requires rank=importance; max_tokens admits greedily by estimate. Last pattern override wins. Project: unique listed name, absolute path returned by list_projects, or #index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rankNoOrders the selection with importance-v1 and controls max_tokens admission; omission keeps ordinary order and avoids dependency or Git-history work.
viewNoChooses tree, file content, or both for the pack.tree-content
focusNoSeeds focus-v1 order from 1..16 selected paths; requires rank=importance and never widens selection.
pathsNoNarrows selection to literal paths for existing project-relative files or directories; glob characters are ordinary.
branchNoRemote Git branch; invalid for local projects.
detailNoContent transform: full adds no transformations; transformations enabled by the active profile still apply. Compact removes comments and blank lines, and signatures keeps supported code signatures; other languages remain unchanged.full
formatNoChooses readable markdown/text or structured JSON/XML output.markdown
profileNoSelection profile: standard uses all eight exclusion toggles plus gitignore; local uses the desktop profile listed by list_projects.profiles; otherwise give a portable profile path inside the project.
projectNounique listed name, absolute path returned by list_projects, or #index.
git_scopeNoNarrows to staged, changed (including untracked files), or diff:<ref>..<ref> paths; content stays from the current working tree.
max_tokensNoSets greedy content admission; document structure and its report are outside this heuristic token budget.
tracked_onlyNoRestricts results to Git-tracked files; accepts a boolean or its string form.
expand_relatedNoAdds resolved neighbours of seed files without widening filters or Git scope; stops at 400 files and reports the limit.
max_file_bytesNoExcludes selected files larger than this byte count; accepts an integer or numeric string.
exclude_patternsNoRemoves paths with the same project-relative glob syntax as include_patterns.
include_patternsNoNarrows with project-relative '/' globs: '*' and '?' stay in one segment, '**/' spans depths, and '{a,b}' alternates; matching is case-sensitive, while '!' and '[...]' are rejected.
detail_by_patternNoOverrides detail by file in array order; the last match wins, never widens selection, and unmatched or invalid entries are reported.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed29 schema fields changedv5.2.0
    • changedInput schema / properties / branch / description
      Previous value: -"Optional Git branch for a remote project URL; invalid for local project paths."New value: +"Remote Git branch; invalid for local projects."
    • changedInput schema / properties / detail / description
      Previous value: -"Collapse code to signatures or strip comments/blank lines to fit large projects into a budget; unsupported languages are returned unchanged."New value: +"Content transform: full adds no transformations; transformations enabled by the active profile still apply. Compact removes comments and blank lines, and signatures keeps supported code signatures; other languages remain unchanged."
    • addedInput schema / properties / detail_by_pattern
      Added value: +{
      +  "description": "Overrides detail by file in array order; the last match wins, never widens selection, and unmatched or invalid entries are reported.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "detail": {
      +        "enum": [
      +          "full",
      +          "compact",
      +          "signatures"
      +        ],
      +        "type": "string"
      +      },
      +      "patterns": {
      +        "description": "Uses the include_patterns glob syntax.",
      +        "items": {
      +          "maxLength": 512,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 32,
      +        "minItems": 1,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "patterns",
      +      "detail"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 16,
      +  "type": "array"
      +}
    • changedInput schema / properties / exclude_patterns / description
      Previous value: -"Project-relative glob patterns using '/' to exclude additional paths."New value: +"Removes paths with the same project-relative glob syntax as include_patterns."
    • removedInput schema / properties / exclude_patterns / items
      Removed value: -{
      -  "maxLength": 512,
      -  "minLength": 1,
      -  "type": "string"
      -}
    • removedInput schema / properties / exclude_patterns / maxItems
      Removed value: -256
    • addedInput schema / properties / exclude_patterns / oneOf
      Added value: +[
      +  {
      +    "maxLength": 512,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "maxLength": 512,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "maxItems": 256,
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / exclude_patterns / type
      Removed value: -"array"
    • addedInput schema / properties / expand_related
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Adds resolved neighbours of seed files without widening filters or Git scope; stops at 400 files and reports the limit.",
      +  "properties": {
      +    "direction": {
      +      "default": "both",
      +      "description": "Traversal direction, matching related_files.",
      +      "enum": [
      +        "dependencies",
      +        "dependents",
      +        "both"
      +      ],
      +      "type": "string"
      +    },
      +    "hops": {
      +      "default": 1,
      +      "description": "Number of edges to follow from each seed.",
      +      "maximum": 2,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    "seeds": {
      +      "description": "Selected project-relative seed files; directories and globs are invalid.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "maxItems": 16,
      +      "minItems": 1,
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "seeds"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / focus
      Added value: +{
      +  "description": "Seeds focus-v1 order from 1..16 selected paths; requires rank=importance and never widens selection.",
      +  "oneOf": [
      +    {
      +      "maxLength": 4096,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "items": {
      +        "maxLength": 4096,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "maxItems": 16,
      +      "minItems": 1,
      +      "type": "array"
      +    }
      +  ]
      +}
    • addedInput schema / properties / format / description
      Added value: +"Chooses readable markdown/text or structured JSON/XML output."
    • changedInput schema / properties / git_scope / description
      Previous value: -"Further restrict results to staged files, all current changes, or files changed between two Git refs."New value: +"Narrows to staged, changed (including untracked files), or diff:<ref>..<ref> paths; content stays from the current working tree."
    • changedInput schema / properties / include_patterns / description
      Previous value: -"Project-relative glob patterns using '/'. They only narrow built-in and gitignore filtering."New value: +"Narrows with project-relative '/' globs: '*' and '?' stay in one segment, '**/' spans depths, and '{a,b}' alternates; matching is case-sensitive, while '!' and '[...]' are rejected."
    • removedInput schema / properties / include_patterns / items
      Removed value: -{
      -  "maxLength": 512,
      -  "minLength": 1,
      -  "type": "string"
      -}
    • removedInput schema / properties / include_patterns / maxItems
      Removed value: -256
    • addedInput schema / properties / include_patterns / oneOf
      Added value: +[
      +  {
      +    "maxLength": 512,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "maxLength": 512,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "maxItems": 256,
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / include_patterns / type
      Removed value: -"array"
    • changedInput schema / properties / max_file_bytes / description
      Previous value: -"Exclude otherwise selected files strictly larger than this byte count; integer or numeric string."New value: +"Excludes selected files larger than this byte count; accepts an integer or numeric string."
    • changedInput schema / properties / max_tokens / description
      Previous value: -"Maximum estimated content tokens to include; accepts an integer or numeric string. Document structure is outside this budget."New value: +"Sets greedy content admission; document structure and its report are outside this heuristic token budget."
    • changedInput schema / properties / paths / description
      Previous value: -"Existing project-relative files or directories that narrow the selection."New value: +"Narrows selection to literal paths for existing project-relative files or directories; glob characters are ordinary."
    • removedInput schema / properties / paths / items
      Removed value: -{
      -  "maxLength": 4096,
      -  "minLength": 1,
      -  "type": "string"
      -}
    • removedInput schema / properties / paths / maxItems
      Removed value: -256
    • addedInput schema / properties / paths / oneOf
      Added value: +[
      +  {
      +    "maxLength": 4096,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "maxLength": 4096,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "maxItems": 256,
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / paths / type
      Removed value: -"array"
    • changedInput schema / properties / profile / description
      Previous value: -"Selection profile: 'standard', 'local', or a portable profile JSON path inside the project root."New value: +"Selection profile: standard uses all eight exclusion toggles plus gitignore; local uses the desktop profile listed by list_projects.profiles; otherwise give a portable profile path inside the project."
    • changedInput schema / properties / project / description
      Previous value: -"Absolute root path returned by list_projects, or a Git URL when the server allows remote sources. Optional only when one local root is configured."New value: +"unique listed name, absolute path returned by list_projects, or #index."
    • addedInput schema / properties / rank
      Added value: +{
      +  "description": "Orders the selection with importance-v1 and controls max_tokens admission; omission keeps ordinary order and avoids dependency or Git-history work.",
      +  "enum": [
      +    "importance"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / tracked_only / description
      Previous value: -"Restrict results to files tracked by Git; accepts a boolean or the string 'true' or 'false'."New value: +"Restricts results to Git-tracked files; accepts a boolean or its string form."
    • addedInput schema / properties / view / description
      Added value: +"Chooses tree, file content, or both for the pack."
  2. First observedv5.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly=true, destructive=false, openWorld=false, so the safety profile is covered. The description adds genuinely new behavioral context: output is inline 'untrusted project data', there is a 50,000-character threshold that switches the return to pack_id plus preview, and 'detail=full still transforms content'. Some rules it repeats (focus requires rank, greedy admission, last-match-wins) are already in the schema, which keeps this from a 5.

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?

Purpose and routing are correctly front-loaded, but the closing 'Key parameters: ...' enumeration and the 'Project: unique listed name...' clause duplicate a 100%-covered schema verbatim, which is waste rather than conciseness. The semicolon-chained cross-parameter rules are also hard to parse in a single breath.

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?

For a 17-parameter tool with nested objects and no output schema, the description covers the essentials: what it produces, the inline-vs-pack_id return split, and the routing to read_pack and get_file. It stops short of describing selection/ordering behavior in depth, but with 100% schema coverage that gap is minor.

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 all 17 parameters are already documented in the schema, including cross-parameter rules like 'requires rank=importance' and 'last match wins'. The description's parameter list and the 'Project:' clause largely restate the schema, adding no syntax or semantics the schema lacks. Baseline 3 is correct when the schema does the heavy lifting.

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 opening sentence states a specific verb+resource ('Builds multi-file project context') and immediately contrasts with the sibling it is not: 'use get_file for one file.' An agent can distinguish it from get_tree, search_project, analyze and get_file 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?

Explicit sequencing guidance is given ('Use it after get_tree, search_project, or analyze'), the alternative for single files is named (get_file), and the downstream handoff is spelled out (pack_id plus preview above 50,000 characters for read_pack). Both when-to-use and which-other-tool conditions are covered.

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