Skip to main content
Glama
ycyun

ABLESTACK MOLD MCP Server

by ycyun

mold_signDebug

Debug and validate API signatures by generating normalized strings, Base64 signatures, URL-encoded signatures, and final request URLs for ABLESTACK MOLD MCP Server API calls.

Instructions

정규화 문자열, 서명(Base64), URL 인코딩 서명, 최종 요청 URL을 생성해 점검합니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
paramsNo
includeResponseNo
apiKeyFieldNo

Implementation Reference

  • Registers the mold_signDebug MCP tool, defining its metadata, input schema using Zod, and a thin handler function that invokes buildSignedUrlDebug and formats the response.
    server.registerTool( "mold_signDebug", { title: "MOLD 서명/URL 디버그", description: "정규화 문자열, 서명(Base64), URL 인코딩 서명, 최종 요청 URL을 생성해 점검합니다.", inputSchema: { command: z.string(), params: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(), includeResponse: z.boolean().optional(), apiKeyField: z.enum(["apiKey", "apikey"]).optional(), }, }, async ({ command, params, includeResponse = true, apiKeyField = "apiKey" }) => { const dbg = buildSignedUrlDebug(command, params ?? {}, { includeResponse, apiKeyField }); return { content: [{ type: "text", text: JSON.stringify(dbg, null, 2) }] }; } );
  • The MCP tool handler function for mold_signDebug, which calls the helper and returns structured content.
    async ({ command, params, includeResponse = true, apiKeyField = "apiKey" }) => { const dbg = buildSignedUrlDebug(command, params ?? {}, { includeResponse, apiKeyField }); return { content: [{ type: "text", text: JSON.stringify(dbg, null, 2) }] }; }
  • Core helper function implementing the debug logic: normalizes parameters, computes HMAC signature, builds and encodes the final signed URL, returns debug info.
    export function buildSignedUrlDebug(command, params = {}, { includeResponse = true, apiKeyField = "apiKey" } = {}) { const cfg = getConfig(); if (!cfg.endpoint || !cfg.apiKey || !cfg.secret) { throw new Error( "MOLD 연결정보가 없습니다. mold_setConfig 도구로 endpoint/apiKey/secret 을 설정하세요." ); } const baseParams = { ...(includeResponse ? { response: "json" } : {}), ...params, command }; baseParams[apiKeyField] = cfg.apiKey; const normPairs = Object.keys(baseParams) .sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())) .map((k) => { const v = baseParams[k]; const encV = encodeURIComponent(String(v)).replace(/\+/g, "%20"); return `${k.toLowerCase()}=${encV.toLowerCase()}`; }); const normalized = normPairs.join("&"); const signatureBase64 = hmac(cfg.algo, cfg.secret, normalized); const signatureUrlEncoded = encodeURIComponent(signatureBase64); const query = Object.entries(baseParams) .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`) .join("&"); const sep = cfg.endpoint.includes("?") ? "&" : "?"; const finalUrl = `${cfg.endpoint}${sep}${query}&signature=${signatureUrlEncoded}`; return { endpoint: cfg.endpoint, apiKeyFieldUsed: apiKeyField, includeResponse, normalized, signatureBase64, signatureUrlEncoded, finalUrl, signedParams: baseParams, }; }

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/ycyun/ablestack-MCP-server'

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