Skip to main content
Glama
jphyqr

HashBuilds Secure Prompts

by jphyqr

get_embed_code

Generate HTML and React embed code to display security verification badges for registered prompts on websites.

Instructions

Generate HTML and React embed code for displaying a secure prompt badge. Use this after registering a prompt to get the code to add to your website.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptIdYesThe ID of the secure prompt

Implementation Reference

  • Core handler function that generates HTML embed code and React component code for displaying a secure prompt badge using the provided promptId. Returns an object with htmlCode, reactCode, and scriptUrl.
    function generateEmbedCode(args: { promptId: string }): { htmlCode: string; reactCode: string; scriptUrl: string; } { const scriptUrl = "https://www.hashbuilds.com/sp.js"; return { htmlCode: `<!-- HashBuilds Secure Prompt Badge --> <div data-secure-prompt-id="${args.promptId}"> <pre data-secure-prompt-content="${args.promptId}">YOUR_PROMPT_TEXT_HERE</pre> </div> <script src="${scriptUrl}" async></script>`, reactCode: `// React/Next.js Component import Script from "next/script"; export function SecurePromptBadge() { return ( <> <div data-secure-prompt-id="${args.promptId}"> <pre data-secure-prompt-content="${args.promptId}"> {/* Your prompt text here */} </pre> </div> <Script src="${scriptUrl}" strategy="lazyOnload" /> </> ); }`, scriptUrl, }; }
  • src/index.ts:439-454 (registration)
    Tool registration in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema (promptId required).
    { name: "get_embed_code", description: "Generate HTML and React embed code for displaying a secure prompt badge. " + "Use this after registering a prompt to get the code to add to your website.", inputSchema: { type: "object", properties: { promptId: { type: "string", description: "The ID of the secure prompt", }, }, required: ["promptId"], }, },
  • Dispatch handler in the CallToolRequestSchema switch statement. Validates the promptId argument and invokes generateEmbedCode, then returns the result as MCP content.
    case "get_embed_code": { const typedArgs = args as { promptId: string }; if (!typedArgs.promptId) { throw new McpError(ErrorCode.InvalidParams, "promptId is required"); } const result = generateEmbedCode(typedArgs); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jphyqr/secure-prompts-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server