forked from patternfly/patternfly-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresource.aiHelpersSkillsIndex.ts
More file actions
59 lines (51 loc) · 1.44 KB
/
Copy pathresource.aiHelpersSkillsIndex.ts
File metadata and controls
59 lines (51 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { type McpResource } from './server';
import { stringJoin } from './server.helpers';
import { getAiHelpersSkills } from './aiHelpers.skills';
/**
* Name of the resource.
*/
const NAME = 'aihelpers-skills-index';
/**
* URI for the resource.
*/
const URI = 'aihelpers://skills/index';
/**
* Resource configuration.
*/
const CONFIG = {
title: 'ai-helpers Skills Index',
description: 'Lists all available ai-helpers skills with names and descriptions.',
mimeType: 'text/markdown' as const
};
/**
* Resource creator for the ai-helpers skills index.
*/
const aiHelpersSkillsIndexResource = (): McpResource => [
NAME,
URI,
CONFIG,
async (passedUri: URL) => {
const skills = await getAiHelpersSkills();
const header = stringJoin.newline(
'# ai-helpers Skills',
'',
'PatternFly coding skills served from the [ai-helpers](https://github.com/patternfly/ai-helpers) marketplace. Read any skill via `aihelpers://skills/{name}`.',
''
);
const table = stringJoin.newline(
'| Skill | Plugin | Description |',
'|-------|--------|-------------|',
...skills.map(skill => `| ${skill.name} | ${skill.plugin} | ${skill.description} |`)
);
return {
contents: [
{
uri: passedUri?.toString(),
mimeType: 'text/markdown',
text: stringJoin.newline(header, table)
}
]
};
}
];
export { aiHelpersSkillsIndexResource, NAME, URI, CONFIG };