Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class KnowledgeError extends Error {
/**
* Default instruction template
*/
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/.`;
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/.`;

/**
* Allowed template variables that can be used in instruction templates
Expand Down
4 changes: 3 additions & 1 deletion packages/mcp-server/src/__tests__/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ docsets:
// Should return an error
expect(result.isError).toBe(true);
expect(result.content[0].text).toContain("not initialized");
expect(result.content[0].text).toContain("agentic-knowledge init");
expect(result.content[0].text).toContain(
"npx agentic-knowledge-mcp init",
);
});
});
});
23 changes: 4 additions & 19 deletions packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,7 @@ After configuring, the tool will show available docsets here.`,

📚 **AVAILABLE DOCSETS:**
${docsetInfo}

🔍 **STRUCTURED RESPONSE:**
Returns JSON object with:
- instructions: Search guidance text
- search_terms: Primary keywords to search for
- generalized_search_terms: Broader terms for context
- path: Local directory path to search in

Use the path and search terms with your available text search tools.`;
`;

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

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

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