import{findDefinitionByName as n}from"../utils";import{telemetry as r}from"../../../../telemetry/index.js";const t="get-security-schemes",c={type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"API name (or part of it)",minLength:1}}};function p(o,i){o.tool(t,"Get the security schemes for a specific API",c,async({name:s})=>{try{const e=n(i,s);return e?(r.sendMcpToolCalledMessage({server_type:"docs",tool:t}),{content:[{type:"text",text:JSON.stringify({name:e.info?.title,version:e.info?.version,securitySchemes:e.components?.securitySchemes||[],security:e.security||[]},null,2)}]}):{content:[{type:"text",text:`No APIs found matching "${s}"`}]}}catch(e){throw r.sendMcpErrorMessage({server_type:"docs",tool:t,message:e?.message||"",stack:e?.stack||""}),e}})}export{p as registerGetSecuritySchemesTools};
