refac/fix: support delete method for openapi tool servers

This commit is contained in:
Timothy Jaeryang Baek 2025-10-14 18:12:19 -05:00
parent 515e136502
commit 8039cc40f7
2 changed files with 5 additions and 2 deletions

View file

@ -754,7 +754,7 @@ async def execute_tool_server(
) as session:
request_method = getattr(session, http_method.lower())
if http_method in ["post", "put", "patch"]:
if http_method in ["post", "put", "patch", "delete"]:
async with request_method(
final_url,
json=body_params,

View file

@ -494,7 +494,10 @@ export const executeToolServer = async (
headers
};
if (['post', 'put', 'patch'].includes(httpMethod.toLowerCase()) && operation.requestBody) {
if (
['post', 'put', 'patch', 'delete'].includes(httpMethod.toLowerCase()) &&
operation.requestBody
) {
requestOptions.body = JSON.stringify(bodyParams);
}