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