Skip to content

feat(tools): add list_repos MCP tool - #52

Merged
7vignesh merged 2 commits into
mainfrom
feat/list-repos-tool
Oct 13, 2026
Merged

7vignesh merged 2 commits into
mainfrom
feat/list-repos-tool

Conversation

@7vignesh

Copy link
Copy Markdown
Owner

Closes #34.

Problem

There was no way for an agent or user to discover which repos Fossel has memories for, or how many. For people using Fossel across many projects, that is a visibility gap.

Fix

A new list_repos MCP tool backed by a listRepos() function in src/lib/repo.ts (logic in lib, thin tool, per AGENTS.md). It groups memories by repo and returns per-repo counts:

  • live (valid_to IS NULL)
  • superseded (tombstoned)
  • pinned (live only)
  • last-updated date

Ordered by live count descending, then repo key for a stable tie-break. Memories are always written under their canonical repo key (aliases are resolved on write and merged by mergeRepoKeys), so grouping by repo yields canonical keys - no extra alias resolution needed.

Example output:

2 repo(s) with memories:
- acme/app: 12 live, 2 superseded, 1 pinned, updated 2026-10-10
- acme/lib: 3 live, updated 2026-09-28

Tests

tests/list-repos.test.ts: empty db, per-repo counts and ordering, the live/superseded split, and that pinned only counts live memories (a pinned-then-superseded memory counts as superseded, not pinned).

Verification

npm run typecheck clean; full suite 256/256 pass; npm run smoke passes; npm run build succeeds.

There was no way to discover which repos have stored memories. Add a
list_repos tool: a thin wrapper over a new listRepos() lib function that
groups memories by canonical repo key and returns per-repo live /
superseded / pinned counts plus the last-updated date, ordered by live
count. Memories are already stored under canonical keys, so grouping by
repo yields canonical keys directly.

Logic lives in src/lib/repo.ts per the thin-tools convention; the tool
just formats the result. Covered by tests for empty db, ordering, the
live/superseded split, and that pinned only counts live memories.
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fossel Ready Ready Preview Oct 13, 2026 11:05am UTC

@7vignesh
7vignesh merged commit 5f8e854 into main Oct 13, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — 834d0bcb Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a list_repos / repo_stats MCP tool

1 participant