Get Instructions for refining flyonui blocks/code/component or page.
get-refine-instructionsGet step-by-step instructions to refine existing FlyonUI components in your IDE. Use when you need to modify or improve a UI block for React, Vue, Svelte, or Next.js.
Instructions
Get instructions for refining FlyonUI blocks. This tool provides instructions for refining existing FlyonUI blocks. Use this tool when the user requests to refine an existing component. mentions /refine-flyonui or /rui.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:78-107 (registration)Registration of the "get-refine-instructions" tool via server.registerTool(). The registered name is "get-refine-instructions" with a title and description for refining FlyonUI blocks.
server.registerTool( "get-refine-instructions", { title: "Get Instructions for refining flyonui blocks/code/component or page.", description: "Get instructions for refining FlyonUI blocks. This tool provides instructions for refining existing FlyonUI blocks. Use this tool when the user requests to refine an existing component. mentions /refine-flyonui or /rui.", }, async () => { try { const url = `/instructions?path=refine-ui.md`; const response = await apiClient.get(url); if (response.status !== 200) { throw new Error(`HTTP error! status: ${response.status}`); } return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), } ], }; } catch (error) { console.error("Error fetching block metadata:", error); throw new Error("Failed to fetch block metadata"); } } ); - src/index.ts:84-106 (handler)Handler function for the "get-refine-instructions" tool. It makes a GET request to `/instructions?path=refine-ui.md` via the apiClient and returns the response data as text content. On error, it throws a descriptive error.
async () => { try { const url = `/instructions?path=refine-ui.md`; const response = await apiClient.get(url); if (response.status !== 200) { throw new Error(`HTTP error! status: ${response.status}`); } return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), } ], }; } catch (error) { console.error("Error fetching block metadata:", error); throw new Error("Failed to fetch block metadata"); } } - src/index.ts:80-83 (schema)Schema definition for the "get-refine-instructions" tool. It has a title and description but no inputSchema (no required parameters), meaning it takes no arguments.
{ title: "Get Instructions for refining flyonui blocks/code/component or page.", description: "Get instructions for refining FlyonUI blocks. This tool provides instructions for refining existing FlyonUI blocks. Use this tool when the user requests to refine an existing component. mentions /refine-flyonui or /rui.", }, - src/utils/http-client.ts:37-66 (helper)The apiClient.get() helper used by the handler. It creates HTTP methods with authentication headers (including x-license-key), and makes requests to the BASE_URL (https://flyonui.com/api/mcp).
const createMethod = (method: HttpMethod) => { return async <T>( endpoint: string, data?: unknown, options: RequestInit = {} ) => { const headers: HeadersInit = { "Content-Type": "application/json", ...(API_KEY ? { "x-license-key": API_KEY } : {}), ...options.headers, }; const response = await fetch(`${BASE_URL}${endpoint}`, { ...options, method, headers, ...(data ? { body: JSON.stringify(data) } : {}), }); return { status: response.status, data: (await response.json()) as T }; }; }; export const apiClient: HttpClient = { get: createMethod("GET"), post: createMethod("POST"), put: createMethod("PUT"), delete: createMethod("DELETE"), patch: createMethod("PATCH"), };