@damper/mcp 0.3.5 → 0.3.6
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.
- package/dist/index.js +31 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -635,7 +635,10 @@ server.registerTool('get_context_section', {
|
|
|
635
635
|
openWorldHint: false,
|
|
636
636
|
},
|
|
637
637
|
}, async ({ section }) => {
|
|
638
|
-
|
|
638
|
+
// Encode section for URL path - encodeURIComponent doesn't encode * which can cause
|
|
639
|
+
// issues with some proxies/CDNs that interpret * as a wildcard
|
|
640
|
+
const encodedSection = encodeURIComponent(section).replace(/\*/g, '%2A');
|
|
641
|
+
const data = await api('GET', `/api/agent/context/${encodedSection}`);
|
|
639
642
|
// Handle glob pattern response (multiple sections)
|
|
640
643
|
if (data.pattern && data.sections) {
|
|
641
644
|
const lines = [`**Sections matching "${data.pattern}":**\n`];
|
|
@@ -704,6 +707,33 @@ server.registerTool('update_context_section', {
|
|
|
704
707
|
structuredContent: result,
|
|
705
708
|
};
|
|
706
709
|
});
|
|
710
|
+
// Tool: Delete context section
|
|
711
|
+
server.registerTool('delete_context_section', {
|
|
712
|
+
title: 'Delete Context Section',
|
|
713
|
+
description: 'Delete a project context section. Use when documentation is outdated or no longer relevant.',
|
|
714
|
+
inputSchema: z.object({
|
|
715
|
+
section: z.string()
|
|
716
|
+
.regex(/^[a-z][a-z0-9-]{0,49}(\/[a-z][a-z0-9-]{0,49}){0,2}$/)
|
|
717
|
+
.describe('Section name or path to delete (e.g., "overview", "api/architecture")'),
|
|
718
|
+
}),
|
|
719
|
+
outputSchema: z.object({
|
|
720
|
+
success: z.boolean(),
|
|
721
|
+
section: z.string(),
|
|
722
|
+
}),
|
|
723
|
+
annotations: {
|
|
724
|
+
readOnlyHint: false,
|
|
725
|
+
destructiveHint: true,
|
|
726
|
+
idempotentHint: true,
|
|
727
|
+
openWorldHint: false,
|
|
728
|
+
},
|
|
729
|
+
}, async ({ section }) => {
|
|
730
|
+
const encodedSection = encodeURIComponent(section).replace(/\*/g, '%2A');
|
|
731
|
+
const result = await api('DELETE', `/api/agent/context/${encodedSection}`);
|
|
732
|
+
return {
|
|
733
|
+
content: [{ type: 'text', text: `🗑️ Deleted context section: ${result.section}` }],
|
|
734
|
+
structuredContent: result,
|
|
735
|
+
};
|
|
736
|
+
});
|
|
707
737
|
// Tool: Sync project context (bulk upload)
|
|
708
738
|
server.registerTool('sync_project_context', {
|
|
709
739
|
title: 'Sync Project Context',
|