File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
33import { Metadata , asTextContentResult } from './types' ;
4+ import { readEnv } from './server' ;
45
56import { Tool } from '@modelcontextprotocol/sdk/types.js' ;
67
@@ -45,7 +46,12 @@ const docsSearchURL =
4546export const handler = async ( _ : unknown , args : Record < string , unknown > | undefined ) => {
4647 const body = args as any ;
4748 const query = new URLSearchParams ( body ) . toString ( ) ;
48- const result = await fetch ( `${ docsSearchURL } ?${ query } ` ) ;
49+ const stainlessAPIKey = readEnv ( 'STAINLESS_API_KEY' ) ;
50+ const result = await fetch ( `${ docsSearchURL } ?${ query } ` , {
51+ headers : {
52+ ...( stainlessAPIKey && { Authorization : stainlessAPIKey } ) ,
53+ } ,
54+ } ) ;
4955
5056 if ( ! result . ok ) {
5157 throw new Error (
You can’t perform that action at this time.
0 commit comments