MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / mapTools

Function mapTools

src/integrations/claude-plugins.ts:141–150  ·  view source on GitHub ↗
(tools: unknown)

Source from the content-addressed store, hash-verified

139};
140
141function mapTools(tools: unknown): string[] | undefined {
142 if (!tools) return undefined;
143 const list = Array.isArray(tools) ? tools : String(tools).split(',');
144 const out = new Set<string>();
145 for (const t of list) {
146 const key = String(t).trim().toLowerCase().replace(/[^a-z0-9]/g, '');
147 for (const mapped of TOOL_NAME_MAP[key] ?? []) out.add(mapped);
148 }
149 return out.size > 0 ? [...out] : undefined;
150}
151
152function parseAgent(raw: string, fallbackName: string): { name: string; role: RoleConfig } | null {
153 const m = raw.match(/^---\s*\n([\s\S]*?)\n---\s*\r?\n?([\s\S]*)$/);

Callers 1

parseAgentFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected