Skip to main content
Glama
jphyqr

HashBuilds Secure Prompts

by jphyqr

get_embed_code

Generate HTML and React embed code to display a secure prompt verification badge on your website after registering a prompt for security checks.

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

  • Handler for the 'get_embed_code' tool call. Validates the promptId argument and invokes generateEmbedCode to produce the embed code, returning it as text 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),
          },
        ],
      };
    }
  • Core helper function that generates HTML and React embed code snippets for displaying the secure prompt badge using the provided promptId.
    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)
    Registration of the 'get_embed_code' tool in the listTools response, including name, description, and input schema.
    {
      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"],
      },
    },
  • Input schema definition for the 'get_embed_code' tool, specifying the required promptId parameter.
    inputSchema: {
      type: "object",
      properties: {
        promptId: {
          type: "string",
          description: "The ID of the secure prompt",
        },
      },
      required: ["promptId"],
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool 'generate[s]' code but doesn't describe what the output looks like (HTML vs React format details), whether there are rate limits, authentication requirements, or potential side effects. For a code generation tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with zero waste. The first sentence states the core purpose, and the second provides usage guidance. Every word serves a clear function, and the information is front-loaded appropriately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (code generation with one parameter) and lack of both annotations and output schema, the description is minimally adequate. It covers the basic purpose and usage sequence but doesn't address output format, error conditions, or integration details that would be helpful for a developer implementing this. The absence of output schema means the description should ideally explain what gets returned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single 'promptId' parameter. The description adds marginal value by implying the prompt must be 'registered' first, which provides context for the parameter's purpose. However, it doesn't provide additional syntax, format, or validation details beyond what the schema provides, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generate HTML and React embed code for displaying a secure prompt badge.' It specifies both the action (generate code) and the resource (embed code for secure prompt badge). However, it doesn't explicitly differentiate from sibling tools like audit_prompts or verify_secure_prompt, which appear to serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: 'Use this after registering a prompt to get the code to add to your website.' This establishes a sequence (after registration) and a target use case (website integration). While it doesn't explicitly mention when NOT to use it or name alternatives, the guidance is specific enough for practical application.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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