Skip to content

Commit b9f997c

Browse files
committed
fix: add logging for OpenAPI tool calls and responses
1 parent 68d42e6 commit b9f997c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

apiBasedTools.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,13 @@ async function callOpenApiSchema(params: {
728728
toolName,
729729
});
730730
const hasRequestBody = !METHODS_WITHOUT_REQUEST_BODY.has(method);
731+
logger.info(`Calling OpenAPI tool "${toolName}" with method ${method} at URL ${requestUrl}`);
731732
const response = await fetch(hasRequestBody ? requestUrl : appendInputsToQueryString(requestUrl, body), {
732733
method,
733734
headers: createToolRequestHeaders(httpExtra, userTimeZone),
734735
body: hasRequestBody ? JSON.stringify(body) : undefined,
735736
});
737+
logger.info(`Received response with status ${response.status} from OpenAPI tool "${toolName}"`);
736738

737739
return parseOpenApiToolResponse(response);
738740
}

0 commit comments

Comments
 (0)