You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib/mcp/index.ts
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,46 @@ server.tool(
89
89
},
90
90
);
91
91
92
+
server.prompt(
93
+
{
94
+
name: 'svelte-task-prompt',
95
+
title: 'Svelte Task Prompt',
96
+
description:
97
+
'Use this Prompt to ask for any svelte related task. It will automatically instruct the LLM on how to best use the autofixer and how to query for documentation pages.',
98
+
schema: v.object({
99
+
task: v.pipe(v.string(),v.description('The task to be performed')),
100
+
}),
101
+
},
102
+
async({ task })=>{
103
+
// TODO: implement logic to fetch the available docs paths to return in the prompt
104
+
constavailable_docs: string[]=[];
105
+
106
+
return{
107
+
messages: [
108
+
{
109
+
role: 'user',
110
+
content: {
111
+
type: 'text',
112
+
text: `You are a Svelte expert tasked to build components and utilities for Svelte developers. If you need documentation for anything related to Svelte you can invoke the tool \`get_documentation\` with one of the following paths:
113
+
<available-docs-paths>
114
+
${JSON.stringify(available_docs,null,2)}
115
+
</available-docs-paths>
116
+
117
+
Every time you write a Svelte component or a Svelte module you MUST invoke the \`svelte-autofixer\` tool providing the code. The tool will return a list of issues or suggestions. If there are any issues or suggestions you MUST fix them and call the tool again with the updated code. You MUST keep doing this until the tool returns no issues or suggestions. Only then you can return the code to the user.
0 commit comments