Skip to content

Commit eeb93d0

Browse files
committed
feat: instruct searching sub folders
1 parent 6ae2ff0 commit eeb93d0

3 files changed

Lines changed: 8 additions & 21 deletions

File tree

packages/core/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class KnowledgeError extends Error {
164164
/**
165165
* Default instruction template
166166
*/
167-
export const DEFAULT_TEMPLATE = `Use available text search tools to search for {{keywords}} in {{local_path}}. Try broader terms if needed. Skip: node_modules/, .git/, build/, dist/.`;
167+
export const DEFAULT_TEMPLATE = `Use available text search tools to search for {{keywords}} in {{local_path}} and its sub folders. Try broader terms if needed. Skip: node_modules/, .git/, build/, dist/.`;
168168

169169
/**
170170
* Allowed template variables that can be used in instruction templates

packages/mcp-server/src/__tests__/integration.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ docsets:
197197
// Should return an error
198198
expect(result.isError).toBe(true);
199199
expect(result.content[0].text).toContain("not initialized");
200-
expect(result.content[0].text).toContain("agentic-knowledge init");
200+
expect(result.content[0].text).toContain(
201+
"npx agentic-knowledge-mcp init",
202+
);
201203
});
202204
});
203205
});

packages/mcp-server/src/server.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,7 @@ After configuring, the tool will show available docsets here.`,
178178
179179
📚 **AVAILABLE DOCSETS:**
180180
${docsetInfo}
181-
182-
🔍 **STRUCTURED RESPONSE:**
183-
Returns JSON object with:
184-
- instructions: Search guidance text
185-
- search_terms: Primary keywords to search for
186-
- generalized_search_terms: Broader terms for context
187-
- path: Local directory path to search in
188-
189-
Use the path and search terms with your available text search tools.`;
181+
`;
190182

191183
return {
192184
tools: [
@@ -273,10 +265,7 @@ Use the path and search terms with your available text search tools.`;
273265
const availableIds = config.docsets.map((d) => d.id).join(", ");
274266
throw new Error(
275267
`Docset '${docset_id}' not found.\n\n` +
276-
`Available docsets: ${availableIds}\n\n` +
277-
`To create a new docset:\n` +
278-
`agentic-knowledge create --preset git-repo --id ${docset_id} --name "My Docs" --url <repo-url>\n` +
279-
`agentic-knowledge init ${docset_id}`,
268+
`Available docsets: ${availableIds}\n\n`,
280269
);
281270
}
282271

@@ -298,9 +287,7 @@ Use the path and search terms with your available text search tools.`;
298287
`Docset '${docset_id}' is not initialized.\n\n` +
299288
`The docset is configured but hasn't been initialized yet.\n\n` +
300289
`To initialize this docset:\n` +
301-
`agentic-knowledge init ${docset_id}\n\n` +
302-
`To check status of all docsets:\n` +
303-
`agentic-knowledge status`,
290+
`npx agentic-knowledge-mcp init ${docset_id}\n\n`,
304291
);
305292
}
306293

@@ -329,9 +316,7 @@ Use the path and search terms with your available text search tools.`;
329316
`Docset '${docset_id}' is not initialized.\n\n` +
330317
`The docset is configured but hasn't been initialized yet.\n\n` +
331318
`To initialize this docset:\n` +
332-
`agentic-knowledge init ${docset_id}\n\n` +
333-
`To check status of all docsets:\n` +
334-
`agentic-knowledge status`,
319+
`npx agentic-knowledge-mcp init ${docset_id}\n\n`,
335320
);
336321
}
337322
} else {

0 commit comments

Comments
 (0)