Skip to content

Commit 3342d82

Browse files
committed
REAMDE.md updated
1 parent f65c41e commit 3342d82

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Suggests which **fields** to request and which tool to use (`count`, `query_fast
244244
| Parameter | Type | Required | Description |
245245
| ------------ | ------ | -------- | ----------------------------------------------------------------------------------------------- |
246246
| `namespace` | string | Yes | Namespace to query (must match a name from `list_namespaces`) |
247-
| `user_query` | string | Yes | User’s question or intent (e.g. "list papers by Lakos with titles", "how many papers by Wong?") |
247+
| `user_query` | string | Yes | User’s question or intent (e.g. "list papers by John Doe with titles", "how many papers by Wong?") |
248248

249249
**Returns:** `suggested_fields` (only fields that exist in that namespace), `use_count_tool`, `recommended_tool`, `explanation`, and `namespace_found`.
250250

@@ -314,15 +314,15 @@ Rules:
314314

315315
### `count`
316316

317-
Returns the **unique document count** matching a metadata filter and semantic query. Use for questions like "how many papers by Lakos?" instead of the `query` tool. For performance, the count tool uses **semantic (dense) search only** (no hybrid or lexical) and requests only document identifiers (`document_number`, `url`, `doc_id`)—no chunk content—then deduplicates by document.
317+
Returns the **unique document count** matching a metadata filter and semantic query. Use for questions like "how many papers by John Doe?" instead of the `query` tool. For performance, the count tool uses **semantic (dense) search only** (no hybrid or lexical) and requests only document identifiers (`document_number`, `url`, `doc_id`)—no chunk content—then deduplicates by document.
318318

319319
**Parameters:**
320320

321321
| Parameter | Type | Required | Description |
322322
| ----------------- | ------ | -------- | -------------------------------------------------------------------------------------------- |
323323
| `namespace` | string | Yes | Namespace to count in (use `list_namespaces` to discover) |
324324
| `query_text` | string | Yes | Search query; use a broad term (e.g. `"paper"`, `"document"`) when counting by metadata only |
325-
| `metadata_filter` | object | No | Same operators as `query` (e.g. `{"author": {"$in": ["John Lakos"]}}` for wg21-papers) |
325+
| `metadata_filter` | object | No | Same operators as `query` (e.g. `{"author": {"$in": ["John Doe"]}}` for wg21-papers) |
326326

327327
**Returns:** JSON with `count` (unique documents, up to 10,000), and `truncated: true` if there are at least 10,000 matches.
328328

@@ -334,7 +334,7 @@ Returns the **unique document count** matching a metadata filter and semantic qu
334334
"count": 42,
335335
"truncated": false,
336336
"namespace": "wg21-papers",
337-
"metadata_filter": { "author": { "$in": ["John Lakos"] } }
337+
"metadata_filter": { "author": { "$in": ["John Doe"] } }
338338
}
339339
```
340340

@@ -402,7 +402,7 @@ Metadata filters allow you to narrow down search results based on document prope
402402
{"status": "published"}
403403

404404
// Exact string match - NOTE: requires full exact match
405-
{"author": "John Lakos"} // Only matches if author field is exactly "John Lakos"
405+
{"author": "John Doe"} // Only matches if author field is exactly "John Doe"
406406

407407
// Array field contains value (use $in only for array-type fields)
408408
{"tags": {"$in": ["cpp", "contracts"]}} // Only if tags is stored as an array
@@ -431,8 +431,8 @@ Metadata filters allow you to narrow down search results based on document prope
431431
**Important Limitations:**
432432

433433
- **String fields require EXACT match** - No wildcards, partial matches, or substring searches
434-
- **Comma-separated strings**: If a field contains `"John Lakos, Herb Sutter"`, you cannot filter for just `"John Lakos"`
435-
- You must match the entire string: `{"author": "John Lakos, Herb Sutter"}`
434+
- **Comma-separated strings**: If a field contains `"John Doe, Herb Sutter"`, you cannot filter for just `"John Doe"`
435+
- You must match the entire string: `{"author": "John Doe, Herb Sutter"}`
436436
- To filter by individual authors, the data must be stored as an array field
437437
- **`$in` and `$nin` operators**: Only work on array-type fields, not comma-separated strings
438438
- **Unsupported operators are rejected**: Unknown operators (for example `$regex`) return a validation error

src/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('suggestQueryParams', () => {
1212
};
1313

1414
it('suggests count tool and minimal fields for count-style queries', () => {
15-
const r = suggestQueryParams(wg21Fields, 'How many papers by Lakos?');
15+
const r = suggestQueryParams(wg21Fields, 'How many papers by John Doe?');
1616
expect(r.use_count_tool).toBe(true);
1717
expect(r.suggested_fields).toContain('document_number');
1818
expect(r.suggested_fields).toContain('url');

src/server/tools/count-tool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function registerCountTool(server: McpServer): void {
2424
{
2525
description:
2626
'Get the number of unique documents matching a metadata filter and semantic query. ' +
27-
'Use when the user asks for a count (e.g. "how many papers by J. Lakos?", "John\'s paper count"). ' +
27+
'Use when the user asks for a count (e.g. "how many papers by J. John Doe?", "John\'s paper count"). ' +
2828
'Uses semantic (dense) search only and requests only document identifiers (no content) for performance. ' +
2929
'Returns the number of unique documents (deduped by document_number/url/doc_id) up to 10,000; truncated=true if at least that many. ' +
3030
'Mandatory flow: call suggest_query_params first, then count. ' +
@@ -43,7 +43,7 @@ export function registerCountTool(server: McpServer): void {
4343
metadata_filter: metadataFilterSchema
4444
.optional()
4545
.describe(
46-
'Optional metadata filter. Use exact field names from list_namespaces. E.g. {"author": {"$in": ["John Lakos", "J. Lakos"]}} for author count.'
46+
'Optional metadata filter. Use exact field names from list_namespaces. E.g. {"author": {"$in": ["John Doe", "J. John Doe"]}} for author count.'
4747
),
4848
},
4949
},

src/server/tools/suggest-query-params-tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function registerSuggestQueryParamsTool(server: McpServer): void {
2525
user_query: z
2626
.string()
2727
.describe(
28-
'The user\'s natural language question or intent (e.g. "list papers by Lakos with titles and links", "how many papers by Wong?", "what do the contracts papers say?").'
28+
'The user\'s natural language question or intent (e.g. "list papers by John Doe with titles and links", "how many papers by Wong?", "what do the contracts papers say?").'
2929
),
3030
},
3131
},

0 commit comments

Comments
 (0)