MCPcopy Index your code
hub / github.com/continuedev/continue / readSkillImpl

Function readSkillImpl

core/tools/implementations/readSkill.ts:6–43  ·  view source on GitHub ↗
(args, extras)

Source from the content-addressed store, hash-verified

4import { getStringArg } from "../parseArgs";
5
6export const readSkillImpl: ToolImpl = async (args, extras) => {
7 const skillName = getStringArg(args, "skillName");
8
9 const { skills } = await loadMarkdownSkills(extras.ide);
10
11 const skill = skills.find((s) => s.name === skillName);
12
13 if (!skill) {
14 const availableSkills = skills.map((s) => s.name).join(", ");
15 throw new ContinueError(
16 ContinueErrorReason.SkillNotFound,
17 `Skill "${skillName}" not found. Available skills: ${availableSkills || "none"}`,
18 );
19 }
20
21 let content = skill.content;
22
23 if (skill.files.length > 0) {
24 content += `\n
25## Supporting files
26Skill directory:
27${skill.files.join("\n")}
28
29Use the read file tool to access these files as needed.`;
30 }
31
32 return [
33 {
34 name: `Skill: ${skill.name}`,
35 description: skill.description,
36 content,
37 uri: {
38 type: "file",
39 value: skill.path,
40 },
41 },
42 ];
43};

Callers 1

callBuiltInToolFunction · 0.90

Calls 2

getStringArgFunction · 0.90
loadMarkdownSkillsFunction · 0.90

Tested by

no test coverage detected