You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: USER_GUIDE.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1686,6 +1686,10 @@ cdidx includes a built-in **MCP (Model Context Protocol) server**. MCP is a stan
1686
1686
1687
1687
Tool results include structured JSON in `structuredContent` plus a short text summary in `content`, so AI tools can parse typed data without scraping large text blocks.
1688
1688
1689
+
Capped MCP result tools report `truncated` and `more_available` in `structuredContent` when more rows exist than the requested `limit`, so clients can avoid treating a capped page as exhaustive.
1690
+
1691
+
Graph tools that can page through result sets (`references`, `callers`, and `callees`) also return `offset` and, when truncated, `next_offset`; pass that value back as `offset` to fetch the next page without re-reading earlier rows.
-**MCP capped result payloads now disclose truncation (#1727)** — capped search and graph tool responses now include `truncated` and `more_available` so clients can distinguish exact-limit result sets from incomplete pages.
-**MCP graph tools now expose offset pagination (#1729)** — `references`, `callers`, and `callees` accept `offset` and return `next_offset` on truncated pages so clients can fetch subsequent pages without re-fetching earlier rows.
sql+=" GROUP BY f.path, f.lang, r.container_kind, r.container_name, r.symbol_name";
123
123
}
124
-
sql+=$" ORDER BY CASE WHEN @preferExactCase = 1 AND r.symbol_name = @rawQuery THEN 0 ELSE 1 END, {(referenceKind==null?GetPathBucketOrderSql("r.path"):PathBucketOrder)}, CASE WHEN lower(r.symbol_name) = lower(@rankingQuery) THEN 0 ELSE 1 END, {BuildReferenceRankOrderSql(rankMode)}, {(referenceKind==null?"r.path":"f.path")}, first_line LIMIT @limit";
124
+
sql+=$" ORDER BY CASE WHEN @preferExactCase = 1 AND r.symbol_name = @rawQuery THEN 0 ELSE 1 END, {(referenceKind==null?GetPathBucketOrderSql("r.path"):PathBucketOrder)}, CASE WHEN lower(r.symbol_name) = lower(@rankingQuery) THEN 0 ELSE 1 END, {BuildReferenceRankOrderSql(rankMode)}, {(referenceKind==null?"r.path":"f.path")}, first_line LIMIT @limit OFFSET @offset";
sql+=" GROUP BY f.path, f.lang, r.container_kind, r.container_name, r.symbol_name, r.reference_kind";
451
452
}
452
-
sql+=$" ORDER BY CASE WHEN @preferExactCase = 1 AND r.container_name = @rawQuery THEN 0 ELSE 1 END, {(referenceKind==null?GetPathBucketOrderSql("r.path"):PathBucketOrder)}, CASE WHEN lower(r.container_name) = lower(@rankingQuery) THEN 0 ELSE 1 END, {BuildReferenceRankOrderSql(rankMode)}, {(referenceKind==null?"r.path":"f.path")}, first_line LIMIT @limit";
453
+
sql+=$" ORDER BY CASE WHEN @preferExactCase = 1 AND r.container_name = @rawQuery THEN 0 ELSE 1 END, {(referenceKind==null?GetPathBucketOrderSql("r.path"):PathBucketOrder)}, CASE WHEN lower(r.container_name) = lower(@rankingQuery) THEN 0 ELSE 1 END, {BuildReferenceRankOrderSql(rankMode)}, {(referenceKind==null?"r.path":"f.path")}, first_line LIMIT @limit OFFSET @offset";
["query"]=newJsonObject{["type"]="string",["description"]="Search query text. Append `*` to a token to make that token a prefix phrase (`計算*` matches `計算する`)."},
["limit"]=newJsonObject{["type"]="integer",["description"]="Max results (default: 20). Responses include `truncated` and `more_available` when more rows exist.",["default"]=20},
31
31
["lang"]=newJsonObject{["type"]="string",["description"]="Filter by language (e.g. csharp, python, javascript)"},
32
32
["snippetLines"]=newJsonObject{["type"]="integer",["description"]="Max snippet lines per result (default: 8, max: 20)",["default"]=8,["minimum"]=1,["maximum"]=SearchSnippetFormatter.MaxSnippetLines},
33
33
["maxLineWidth"]=newJsonObject{["type"]="integer",["description"]="Clamp very long single-line snippets per line (default: 512; 0 disables clamping). Match lines are clamped around the first match; non-match lines are clamped from the head. Each clamp inserts a `...(+N)...` marker showing how many chars were elided.",["default"]=LineWidthFormatter.DefaultMaxLineWidth,["minimum"]=0,["maximum"]=LineWidthFormatter.MaxAllowedLineWidth},
["limit"]=newJsonObject{["type"]="integer",["description"]="Max results (default: 20). Responses include `truncated`, `more_available`, and `next_offset` when more rows exist.",["default"]=20},
85
+
["offset"]=newJsonObject{["type"]="integer",["description"]="Zero-based result offset for pagination; use `next_offset` from a truncated response.",["default"]=0,["minimum"]=0},
85
86
["maxLineWidth"]=newJsonObject{["type"]="integer",["description"]="Clamp very long single-line context payloads per result (default: 512; 0 disables clamping)",["default"]=LineWidthFormatter.DefaultMaxLineWidth,["minimum"]=0,["maximum"]=LineWidthFormatter.MaxAllowedLineWidth},
86
87
["path"]=newJsonObject{["oneOf"]=newJsonArray{newJsonObject{["type"]="string"},newJsonObject{["type"]="array",["items"]=newJsonObject{["type"]="string"}}},["description"]="Prefer or restrict matches to paths containing this text. Accepts a single string or an array; multiple values are OR'd together."},
87
88
["excludePaths"]=newJsonObject{["type"]="array",["items"]=newJsonObject{["type"]="string"},["description"]="Exclude any paths containing these texts"},
["kind"]=newJsonObject{["type"]="string",["description"]="Filter by call-graph reference kind (call, instantiate, subscribe, friend). Non-call-graph kinds — metadata (attribute, annotation) and type-position (type_reference) — are rejected here; use `references` with the desired kind instead."},
["limit"]=newJsonObject{["type"]="integer",["description"]="Max results (default: 20). Responses include `truncated`, `more_available`, and `next_offset` when more rows exist.",["default"]=20},
111
+
["offset"]=newJsonObject{["type"]="integer",["description"]="Zero-based result offset for pagination; use `next_offset` from a truncated response.",["default"]=0,["minimum"]=0},
110
112
["path"]=newJsonObject{["oneOf"]=newJsonArray{newJsonObject{["type"]="string"},newJsonObject{["type"]="array",["items"]=newJsonObject{["type"]="string"}}},["description"]="Prefer or restrict matches to paths containing this text. Accepts a single string or an array; multiple values are OR'd together."},
111
113
["excludePaths"]=newJsonObject{["type"]="array",["items"]=newJsonObject{["type"]="string"},["description"]="Exclude any paths containing these texts"},
112
114
["excludeTests"]=newJsonObject{["type"]="boolean",["description"]="Exclude likely test files",["default"]=false},
["kind"]=newJsonObject{["type"]="string",["description"]="Filter by call-graph reference kind (call, instantiate, subscribe). Non-call-graph kinds — metadata (attribute, annotation) and type-position (type_reference) — are rejected here; use `references` with the desired kind instead."},
131
133
["rankBy"]=newJsonObject{["type"]="string",["enum"]=newJsonArray{"weighted","count","kind"},["description"]="Ranking model: weighted (default; instantiate=3.0, call=1.0, subscribe=0.1), count, or kind.",["default"]="weighted"},
132
134
["lang"]=newJsonObject{["type"]="string",["description"]="Filter by language"},
["limit"]=newJsonObject{["type"]="integer",["description"]="Max results (default: 20). Responses include `truncated`, `more_available`, and `next_offset` when more rows exist.",["default"]=20},
136
+
["offset"]=newJsonObject{["type"]="integer",["description"]="Zero-based result offset for pagination; use `next_offset` from a truncated response.",["default"]=0,["minimum"]=0},
134
137
["path"]=newJsonObject{["oneOf"]=newJsonArray{newJsonObject{["type"]="string"},newJsonObject{["type"]="array",["items"]=newJsonObject{["type"]="string"}}},["description"]="Prefer or restrict matches to paths containing this text. Accepts a single string or an array; multiple values are OR'd together."},
135
138
["excludePaths"]=newJsonObject{["type"]="array",["items"]=newJsonObject{["type"]="string"},["description"]="Exclude any paths containing these texts"},
136
139
["excludeTests"]=newJsonObject{["type"]="boolean",["description"]="Exclude likely test files",["default"]=false},
0 commit comments