memtrace 0.8.9 → 0.8.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,358 @@
1
+ # Memtrace MCP tool parameters — authoritative reference
2
+
3
+ This file is the single source of truth for the name, type, required-ness,
4
+ default, and constraint of every argument accepted by every Memtrace tool.
5
+ It's generated from the underlying MCP server's `tools/list` schema. If
6
+ you're wondering what to pass to a tool, check this table; if the live tool
7
+ rejects a call, the validator error message here explains why.
8
+
9
+ > **Naming note:** the Memtrace Pi extension registers every Memtrace MCP
10
+ > tool as a native Pi tool named `memtrace_<name>` (e.g. the MCP tool
11
+ > `get_impact` becomes the Pi tool `memtrace_get_impact`). This reference
12
+ > uses the bare MCP name (`get_impact`) for every heading; prefix it with
13
+ > `memtrace_` when calling the tool from Pi.
14
+
15
+ ## Zeroth rule — JSON types are strict
16
+
17
+ The MCP validator does not coerce. `limit: "10"` is a type error even
18
+ though "10" parses as a number. Rejection surfaces as:
19
+
20
+ ```
21
+ MCP error -32602: invalid type: string "10", expected usize
22
+ ```
23
+
24
+ Pass JSON numbers as numbers, booleans as booleans, strings as strings,
25
+ arrays as arrays. No quoting numbers, no `"true"` for booleans.
26
+
27
+ ```json
28
+ // CORRECT
29
+ { "repo_id": "my-repo", "depth": 3, "fuzzy": true, "include_tests": false }
30
+
31
+ // WRONG — every one of these fails validation
32
+ { "repo_id": my-repo, "depth": "3", "fuzzy": "true", "include_tests": 0 }
33
+ ```
34
+
35
+ ## Conventions that appear across tools
36
+
37
+ | Param | Type | Meaning |
38
+ |---|---|---|
39
+ | `repo_id` | string | Repository identifier from `list_indexed_repositories` (usually the repo folder name) |
40
+ | `branch` *or* `branch_name` | string | Git branch. Default `"main"` across every tool. Both spellings occur historically — use whichever the specific tool's schema says |
41
+ | `limit` | integer | Cap on returned results. Always a JSON number, never a string |
42
+ | `depth` | integer | Graph traversal hops. 1–5 is reasonable; >8 explodes on wide graphs |
43
+ | `target` / `symbol` | string | Symbol **name** for graph tools — `get_impact`/`analyze_relationships` use `target`; `get_symbol_context` uses `symbol` |
44
+ | `from` / `to` / `since` / `until` | string | e.g. `"90d ago"`, `"2026-04-17T13:00:00Z"`, `"yesterday"` — relative strings work for temporal tools. **Never `days` on `get_evolution`.** |
45
+
46
+ ## Search & discovery
47
+
48
+ ### `find_code`
49
+ | Field | Type | Required | Default | Notes |
50
+ |---|---|---|---|---|
51
+ | `query` | string | yes | — | Natural-language text |
52
+ | `repo_id` | string | no | all repos | Scope to one repo |
53
+ | `file_path` | string | no | — | Path substring filter |
54
+ | `limit` | integer | no | `20` | Max 100 |
55
+ | `as_of` | string | no | now | Time-travel search |
56
+ | `include_diagnostics` | boolean | no | `false` | Include `id`, `score` in results |
57
+
58
+ No `kind` param — use `find_symbol(kind=...)` instead.
59
+
60
+ ### `find_symbol`
61
+ | Field | Type | Required | Default | Notes |
62
+ |---|---|---|---|---|
63
+ | `name` | string | yes | — | Exact or partial identifier |
64
+ | `fuzzy` | boolean | no | `false` | Exact-match today; field kept for API parity |
65
+ | `edit_distance` | integer | no | `2` | Max 2. Only used when `fuzzy: true` |
66
+ | `repo_id` | string | no | all repos | |
67
+ | `kind` | string | no | — | Same enum as `find_code` |
68
+ | `file_path` | string | no | — | |
69
+ | `limit` | integer | no | `10` | Capped at `50` |
70
+
71
+ ### `get_source_window`
72
+ | Field | Type | Required | Default | Notes |
73
+ |---|---|---|---|---|
74
+ | `file_path` | string | yes | — | Use the path returned by Memtrace search/context tools |
75
+ | `repo_id` | string | no | — | Helps resolve repo-relative and repo-prefixed paths |
76
+ | `start_line` | integer | no | `1` | 1-based line number from a Memtrace result |
77
+ | `end_line` | integer | no | `start_line` | 1-based line number from a Memtrace result |
78
+ | `before_lines` | integer | no | `8` | Context before the span |
79
+ | `after_lines` | integer | no | `24` | Context after the span |
80
+ | `max_lines` | integer | no | `120` | Hard-capped at `400` |
81
+
82
+ ### `list_indexed_repositories`
83
+ No parameters. Call once at session start to get `repo_id` values.
84
+
85
+ ## Relationships
86
+
87
+ ### `get_symbol_context`
88
+ | Field | Type | Required | Default |
89
+ |---|---|---|---|
90
+ | `repo_id` | string | yes | — |
91
+ | `symbol` | string | yes | — |
92
+ | `file_path` | string | no | — |
93
+ | `branch` | string | no | `"main"` |
94
+ | `as_of` | string | no | now |
95
+ | `view` | string | no | `"live"` |
96
+
97
+ Returns: symbol, callers, callees, type_references, community, processes, api_callers_cross_repo.
98
+
99
+ ### `analyze_relationships`
100
+ | Field | Type | Required | Default | Notes |
101
+ |---|---|---|---|---|
102
+ | `repo_id` | string | yes | — | |
103
+ | `target` | string | yes | — | Symbol name |
104
+ | `query_type` | string enum | yes | — | `find_callers` \| `find_callees` \| `class_hierarchy` \| `overrides` \| `imports` \| `exporters` \| `type_usages` |
105
+ | `depth` | integer | no | `3` | Max 10 |
106
+ | `file_path` | string | no | — | Disambiguation hint |
107
+
108
+ ## Impact
109
+
110
+ ### `get_impact`
111
+ | Field | Type | Required | Default | Notes |
112
+ |---|---|---|---|---|
113
+ | `repo_id` | string | yes | — | |
114
+ | `target` | string | yes | — | Symbol name |
115
+ | `direction` | string enum | no | `"both"` | `"upstream"` \| `"downstream"` \| `"both"` |
116
+ | `depth` | integer | no | `5` | Max 15 |
117
+ | `as_of` | string | no | now | |
118
+
119
+ ### `detect_changes`
120
+ | Field | Type | Required | Default | Notes |
121
+ |---|---|---|---|---|
122
+ | `repo_id` | string | yes | — | |
123
+ | `diff` | string | no ‡ | — | Unified git diff text |
124
+ | `changed_files` | array of string | no ‡ | — | Alternative to `diff` |
125
+ | `branch` | string | no | `"main"` | |
126
+
127
+ ‡ Exactly one of `diff` or `changed_files` must be provided.
128
+
129
+ ## Temporal
130
+
131
+ ### `get_evolution`
132
+ | Field | Type | Required | Default | Notes |
133
+ |---|---|---|---|---|
134
+ | `repo_id` | string | yes | — | |
135
+ | `from` | string | yes | — | Start of window. RFC3339, ISO date, epoch, or relative (`"7d ago"`, `"yesterday"`). **Never pass `days`.** |
136
+ | `to` | string | no | now | End of window |
137
+ | `mode` | string enum | no | `"recent"` | `"recent"` \| `"compound"` \| `"summary"` \| `"overview"` (alias for `summary`) |
138
+ | `target` | string | no | — | Symbol name or file path substring scope |
139
+ | `branch` | string | no | any branch | |
140
+ | `file_path` | string | no | — | **`recent` mode only** — substring match on `touched_files` |
141
+ | `kind` | string | no | — | **`recent` mode only** — `"git_commit"` or `"working_tree"` |
142
+ | `limit` | integer | no | `100` | **`recent` mode only** — page size; `0` = server cap |
143
+ | `cursor` | integer | no | `0` | **`recent` mode only** — pagination offset |
144
+
145
+ **Response by mode:**
146
+ - `recent` → `episodes[]`, `totals`, `page` (with `next_cursor`)
147
+ - `compound` → `totals`, `top_changed_files`, `top_touched_symbols`
148
+ - `summary` / `overview` → `totals`, `first_episode`, `last_episode`
149
+
150
+ Modes **`impact`**, **`novel`**, **`directional`** are **not implemented**.
151
+
152
+ ### `get_timeline`
153
+ | Field | Type | Required | Default | Notes |
154
+ |---|---|---|---|---|
155
+ | `repo_id` | string | yes | — | |
156
+ | `scope_path` | string | yes | — | e.g. `"AuthService::validateToken"` |
157
+ | `file_path` | string | yes | — | Containing file |
158
+ | `branch` | string | no | `"main"` | |
159
+
160
+ ### `get_episode_replay`
161
+ | Field | Type | Required | Default | Notes |
162
+ |---|---|---|---|---|
163
+ | `episode_id` | string | † | — | Episode UUID — preferred when known |
164
+ | `repo_id` | string | † | — | Required with `episode_index` when `episode_id` omitted |
165
+ | `episode_index` | integer | † | — | 0 = newest episode |
166
+ | `branch` | string | no | any branch | Used with `episode_index` |
167
+ | `symbol` | string | no | — | Optional filter — scope to one symbol |
168
+ | `kind` | string | no | — | e.g. `Function`, `CALLS` — narrow large commits |
169
+ | `file_path` | string | no | — | Substring filter on record paths |
170
+ | `limit` | integer | no | `200` | Page size per bucket; `0` = no pagination |
171
+ | `cursor` | integer | no | `0` | Pagination offset |
172
+ | `mode` | string | no | default | `"graph_summary"` for digest on large commits |
173
+ | `compress` | boolean | no | `true` | Collapse identical-hash modifications |
174
+
175
+ † Supply `episode_id`, OR `repo_id` + `episode_index`.
176
+
177
+ ### `get_changes_since`
178
+ | Field | Type | Required | Default | Notes |
179
+ |---|---|---|---|---|
180
+ | `repo_id` | string | yes | — | |
181
+ | `since` | string | yes | — | Cutoff timestamp. Same formats as `get_evolution.from`. **Not** `last_episode_id`. |
182
+ | `until` | string | no | now | Optional upper bound |
183
+ | `branch` | string | no | any branch | |
184
+
185
+ Returns `episodes[]` with per-episode change counts and `totals`. Store `until` (or latest episode `reference_time`) as the next session's `since` value.
186
+
187
+ ### `get_cochange_context`
188
+ | Field | Type | Required | Default | Notes |
189
+ |---|---|---|---|---|
190
+ | `repo_id` | string | yes | — | |
191
+ | `target` | string | yes | — | Symbol name or file path |
192
+ | `window_days` | integer | no | `30` | Lookback from `as_of` |
193
+ | `as_of` | string | no | now | Window anchor |
194
+ | `branch` | string | no | any branch | |
195
+ | `limit` | integer | no | `10` | Max cochanged files returned |
196
+
197
+ Returns `cochanged_files[]` with `file_path`, `cochange_count`, `last_cochanged_at`.
198
+
199
+ ## Graph algorithms
200
+
201
+ ### `find_central_symbols`
202
+ | Field | Type | Required | Default | Notes |
203
+ |---|---|---|---|---|
204
+ | `repo_id` | string | yes | — | |
205
+ | `branch` | string | no | any branch | |
206
+ | `kinds` | array of string | no | Function/Method/Class/… | |
207
+ | `limit` | integer | no | `25` | Max 100. Always PageRank — no `method` param. |
208
+
209
+ ### `find_bridge_symbols`
210
+ | Field | Type | Required | Default | Notes |
211
+ |---|---|---|---|---|
212
+ | `repo_id` | string | yes | — | |
213
+ | `branch` | string | no | `"main"` | |
214
+ | `limit` | integer | no | `15` | Max 50 |
215
+
216
+ ### `list_communities`
217
+ | Field | Type | Required | Default | Notes |
218
+ |---|---|---|---|---|
219
+ | `repo_id` | string | yes | — | |
220
+ | `branch` | string | no | `"main"` | |
221
+ | `min_size` | integer | no | `3` | |
222
+ | `limit` | integer | no | `50` | Max 200 |
223
+
224
+ ### `list_processes`
225
+ | Field | Type | Required | Default |
226
+ |---|---|---|---|
227
+ | `repo_id` | string | yes | — |
228
+ | `branch` | string | no | `"main"` |
229
+ | `limit` | integer | no | `50` |
230
+
231
+ ### `get_process_flow`
232
+ | Field | Type | Required | Default |
233
+ |---|---|---|---|
234
+ | `repo_id` | string | yes | — |
235
+ | `process` | string | yes | — |
236
+ | `branch` | string | no | `"main"` |
237
+
238
+ ### `find_dependency_path`
239
+ | Field | Type | Required | Default | Notes |
240
+ |---|---|---|---|---|
241
+ | `repo_id` | string | yes | — | |
242
+ | `source` | string | yes | — | Start symbol name |
243
+ | `target` | string | yes | — | End symbol name |
244
+ | `max_depth` | integer | no | `20` | Max 20 |
245
+ | `edge_type` | string | no | calls+refs+… | Comma-separated or alias |
246
+
247
+ ## Quality
248
+
249
+ ### `get_repository_stats`
250
+ | Field | Type | Required | Default |
251
+ |---|---|---|---|
252
+ | `repo_id` | string | yes | — |
253
+ | `branch` | string | no | `"main"` |
254
+
255
+ ### `find_dead_code`
256
+ | Field | Type | Required | Default | Notes |
257
+ |---|---|---|---|---|
258
+ | `repo_id` | string | yes | — | |
259
+ | `branch` | string | no | `"main"` | |
260
+ | `include_tests` | boolean | no | `false` | |
261
+ | `limit` | integer | no | `50` | |
262
+ | `kinds` | array of string | no | all | Filter, e.g. `["Function","Method"]` |
263
+
264
+ ### `find_most_complex_functions`
265
+ | Field | Type | Required | Default |
266
+ |---|---|---|---|
267
+ | `repo_id` | string | yes | — |
268
+ | `branch` | string | no | `"main"` |
269
+ | `top_n` | integer | no | `20` |
270
+ | `kinds` | array of string | no | Function+Method |
271
+
272
+ ### `calculate_cyclomatic_complexity`
273
+ | Field | Type | Required | Default |
274
+ |---|---|---|---|
275
+ | `repo_id` | string | yes | — |
276
+ | `target` | string | yes | — |
277
+
278
+ ## API topology
279
+
280
+ ### `find_api_endpoints`
281
+ | Field | Type | Required | Default | Notes |
282
+ |---|---|---|---|---|
283
+ | `repo_id` | string | yes | — | The service that handles these endpoints |
284
+ | `method` | string | no | — | HTTP method filter, e.g. `"GET"` |
285
+ | `path_contains` | string | no | — | Substring filter, e.g. `"/users"` |
286
+ | `branch` | string | no | `"main"` | |
287
+ | `limit` | integer | no | `50` | |
288
+
289
+ ### `find_api_calls`
290
+ | Field | Type | Required | Default | Notes |
291
+ |---|---|---|---|---|
292
+ | `repo_id` | string | yes | — | The service making the calls |
293
+ | `method` | string | no | — | |
294
+ | `path_contains` | string | no | — | |
295
+ | `branch` | string | no | `"main"` | |
296
+ | `limit` | integer | no | `50` | |
297
+
298
+ ### `get_api_topology`
299
+ | Field | Type | Required | Default | Notes |
300
+ |---|---|---|---|---|
301
+ | `min_confidence` | number (float) | no | `0.7` | 0.0–1.0 — threshold for cross-repo HTTP edges |
302
+ | `include_external` | boolean | no | `false` | Include calls to services outside indexed repos |
303
+ | `repo_id` | string | no | — | Omit for full cross-service topology |
304
+
305
+ ### `link_repositories`
306
+ Connects already-indexed repos so `get_api_topology` can stitch their HTTP graphs. Parameters vary — see the `link_repositories` tool schema via `memtrace_status` / the live `tools/list` result.
307
+
308
+ ## Indexing
309
+
310
+ ### `index_directory`
311
+ | Field | Type | Required | Default | Notes |
312
+ |---|---|---|---|---|
313
+ | `path` | string | yes | — | Absolute path to the repo root |
314
+ | `repo_id` | string | no | directory name | |
315
+ | `branch` | string | no | `"main"` | |
316
+ | `incremental` | boolean | no | `false` | Re-index only changed files |
317
+ | `clear_existing` | boolean | no | `false` | Wipe before indexing |
318
+ | `skip_embed` | boolean | no | `false` | Skip the embedding stage |
319
+
320
+ ### `check_job_status`
321
+ | Field | Type | Required | Default |
322
+ |---|---|---|---|
323
+ | `job_id` | string (UUID) | yes | — |
324
+
325
+ ### `delete_repository`
326
+ | Field | Type | Required | Default |
327
+ |---|---|---|---|
328
+ | `repo_id` | string | yes | — |
329
+
330
+ ### `watch_directory`
331
+ | Field | Type | Required | Default |
332
+ |---|---|---|---|
333
+ | `path` | string | yes | — |
334
+ | `repo_id` | string | yes | — |
335
+ | `branch` | string | no | `"main"` |
336
+
337
+ ### `unwatch_directory`
338
+ | Field | Type | Required |
339
+ |---|---|---|
340
+ | `path` | string | yes |
341
+
342
+ ### `list_watched_paths`
343
+ No parameters. Returns `{ watches: [{ path, repo_id, branch, started_at, origin }], count }`.
344
+
345
+ ## Style
346
+
347
+ ### `get_style_fingerprint`
348
+ | Field | Type | Required | Default | Notes |
349
+ |---|---|---|---|---|
350
+ | `repo_id` | string | yes | — | |
351
+ | `file_path` | string | no | — | Scope the empirical sample to one file's language/area |
352
+
353
+ ## When this file is wrong
354
+
355
+ It's drift-prone; tool schemas evolve with the Memtrace server. If a live
356
+ tool call rejects with `-32602`, trust the error message and the live
357
+ `tools/list` schema (call `memtrace_status`, then inspect the registered
358
+ tool's parameters) over this doc.
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "lib": ["ES2022"],
7
+ "types": ["node"],
8
+ "strict": true,
9
+ "noEmit": true,
10
+ "allowImportingTsExtensions": true,
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "resolveJsonModule": true,
14
+ "isolatedModules": true
15
+ },
16
+ "include": ["extension/**/*.ts"]
17
+ }