Skip to main content
Glama

threads_for_file

Read-only

Find past AI coding-agent threads that mention a file path, newest first; add a line number to also see the commits behind that line and related sessions and decisions.

Instructions

Past threads that mentioned a file path (substring match, e.g. "embed/mod.rs"), newest first. With line: also the commits behind that line (git blame), their sessions and decisions.

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": {
      "path": "<path>"
    },
    "name": "threads_for_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
lineNo1-based line; path must then be a file in this repo. Adds the commits behind the line (git blame), their sessions, and those sessions' decisions and gotchas.
pathYesFile path or substring, e.g. "embed/mod.rs".
limitNoMax threads (default 15, max 50).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.4
    • addedInput schema / properties / line
      Added value: +{
      +  "description": "1-based line; path must then be a file in this repo. Adds the commits behind the line\n(git blame), their sessions, and those sessions' decisions and gotchas.",
      +  "format": "uint32",
      +  "minimum": 0,
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "anyOf": [
      +    {
      +      "properties": {
      +        "commits": {
      +          "items": {
      +            "properties": {
      +              "committedAt": {
      +                "type": "integer"
      +              },
      +              "sha": {
      +                "type": "string"
      +              },
      +              "shortSha": {
      +                "type": "string"
      +              },
      +              "subject": {
      +                "type": "string"
      +              },
      +              "threads": {
      +                "items": {
      +                  "properties": {
      +                    "edits": {
      +                      "type": "integer"
      +                    },
      +                    "id": {
      +                      "type": "integer"
      +                    },
      +                    "lastActive": {
      +                      "type": [
      +                        "integer",
      +                        "null"
      +                      ]
      +                    },
      +                    "source": {
      +                      "type": "string"
      +                    },
      +                    "title": {
      +                      "type": [
      +                        "string",
      +                        "null"
      +                      ]
      +                    },
      +                    "touch": {
      +                      "type": [
      +                        "string",
      +                        "null"
      +                      ]
      +                    }
      +                  },
      +                  "required": [
      +                    "id",
      +                    "title",
      +                    "source",
      +                    "lastActive",
      +                    "edits",
      +                    "touch"
      +                  ],
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              },
      +              "trace": {
      +                "items": {
      +                  "properties": {
      +                    "agent": {
      +                      "type": [
      +                        "string",
      +                        "null"
      +                      ]
      +                    },
      +                    "contributor": {
      +                      "type": "string"
      +                    },
      +                    "conversationId": {
      +                      "type": [
      +                        "string",
      +                        "null"
      +                      ]
      +                    },
      +                    "conversationUrl": {
      +                      "type": [
      +                        "string",
      +                        "null"
      +                      ]
      +                    },
      +                    "from": {
      +                      "type": "string"
      +                    },
      +                    "model": {
      +                      "type": [
      +                        "string",
      +                        "null"
      +                      ]
      +                    },
      +                    "ranges": {
      +                      "items": {
      +                        "items": {
      +                          "type": "integer"
      +                        },
      +                        "maxItems": 2,
      +                        "minItems": 2,
      +                        "type": "array"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "recordedAt": {
      +                      "type": [
      +                        "string",
      +                        "null"
      +                      ]
      +                    },
      +                    "recordedBeforeCommit": {
      +                      "type": "boolean"
      +                    },
      +                    "revision": {
      +                      "type": "string"
      +                    },
      +                    "threadId": {
      +                      "type": [
      +                        "integer",
      +                        "null"
      +                      ]
      +                    },
      +                    "traceFile": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "from",
      +                    "agent",
      +                    "contributor",
      +                    "model",
      +                    "conversationId",
      +                    "conversationUrl",
      +                    "threadId",
      +                    "ranges",
      +                    "revision",
      +                    "recordedBeforeCommit",
      +                    "recordedAt",
      +                    "traceFile"
      +                  ],
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "required": [
      +              "sha",
      +              "shortSha",
      +              "subject",
      +              "committedAt",
      +              "threads"
      +            ],
      +            "type": "object"
      +          },
      +          "type": [
      +            "array",
      +            "null"
      +          ]
      +        },
      +        "facts": {
      +          "items": {
      +            "properties": {
      +              "extractor": {
      +                "type": "string"
      +              },
      +              "id": {
      +                "type": "integer"
      +              },
      +              "kind": {
      +                "type": "string"
      +              },
      +              "originRef": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "rationale": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "status": {
      +                "enum": [
      +                  "current",
      +                  "disputed",
      +                  "flagged",
      +                  "superseded",
      +                  null
      +                ],
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "supersededBy": {
      +                "properties": {
      +                  "decidedAt": {
      +                    "type": "integer"
      +                  },
      +                  "id": {
      +                    "type": "integer"
      +                  },
      +                  "text": {
      +                    "type": "string"
      +                  },
      +                  "threadId": {
      +                    "type": [
      +                      "integer",
      +                      "null"
      +                    ]
      +                  }
      +                },
      +                "required": [
      +                  "id",
      +                  "text",
      +                  "decidedAt"
      +                ],
      +                "type": [
      +                  "object",
      +                  "null"
      +                ]
      +              },
      +              "text": {
      +                "type": "string"
      +              },
      +              "threadId": {
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "threadId",
      +              "kind",
      +              "text",
      +              "rationale",
      +              "extractor",
      +              "originRef"
      +            ],
      +            "type": "object"
      +          },
      +          "type": [
      +            "array",
      +            "null"
      +          ]
      +        },
      +        "note": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "threads": {
      +          "items": {
      +            "properties": {
      +              "id": {
      +                "type": "integer"
      +              },
      +              "messageCount": {
      +                "type": "integer"
      +              },
      +              "projectPath": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "source": {
      +                "type": "string"
      +              },
      +              "starred": {
      +                "type": "boolean"
      +              },
      +              "title": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "updatedAt": {
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "source",
      +              "title",
      +              "projectPath",
      +              "messageCount",
      +              "updatedAt",
      +              "starred"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "unlinked": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "threads"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "properties": {
      +        "notice": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "notice"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "type": "object"
      +}
  2. Changed4 schema fields changedv0.11.3
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Max threads (default 15, max 50).",
      +  "format": "uint32",
      +  "minimum": 0,
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / path / description
      Previous value: -"A file path or substring (e.g. \"embed/mod.rs\")."New value: +"File path or substring, e.g. \"embed/mod.rs\"."
    • removedInput schema / title
      Removed value: -"FilePathArgs"
  3. Addedv0.6.0

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare that this is a read-only, closed-world lookup, which is the main behavioral fact here. The description adds matching semantics (substring) and result ordering (newest first), and the line parameter explains that commits, sessions, and decisions are pulled in via git blame. It does not cover pagination or how the default/max limit behaves, so the extra context is useful but not deep.

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?

Two sentences, front-loaded with the resource and matching rule, followed by the optional line enrichment. Every clause carries information and nothing is filler.

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?

A read-only lookup with full schema coverage, annotations, and an output schema that handles return-shape concerns. The description covers scope, matching, and ordering, leaving only limit and pagination behavior to the schema, which is acceptable.

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 coverage is 100%: path, line, and limit are all documented in the input schema, including the 1-based line constraint, the default of 15, and the max of 50. The description repeats the substring-match example and the 'line adds git blame' behavior without adding syntax or format information beyond what the schema already provides, so a baseline 3 is correct.

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?

It states a specific verb and resource: retrieve past threads that mention a file path, with substring matching and newest-first ordering, plus the git-blame enrichment when a line is given. The file-path angle is concrete enough to separate it from a generic thread search, but no sibling is named, so differentiation is left to inference.

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?

The intent ('when you want threads tied to a file path, optionally to a specific line') is implied by the two sentences and by the embedded example. There is no explicit when-to-use / when-not-to-use guidance and no pointer to alternatives such as keyword search, recent threads, or the linked-commits tool.

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