Fix formatting
This commit is contained in:
parent
50db0457be
commit
6ce4a0b563
2 changed files with 7 additions and 4 deletions
|
|
@ -34,7 +34,7 @@ export async function getPrompt(
|
||||||
const stringArgs: Record<string, string> = {};
|
const stringArgs: Record<string, string> = {};
|
||||||
if (args) {
|
if (args) {
|
||||||
for (const [key, value] of Object.entries(args)) {
|
for (const [key, value] of Object.entries(args)) {
|
||||||
if (typeof value === 'string') {
|
if (typeof value === "string") {
|
||||||
stringArgs[key] = value;
|
stringArgs[key] = value;
|
||||||
} else if (value === null || value === undefined) {
|
} else if (value === null || value === undefined) {
|
||||||
stringArgs[key] = String(value);
|
stringArgs[key] = String(value);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,10 @@ export async function listTools(client: Client): Promise<McpResponse> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertParameterValue(value: string, schema: JsonSchemaType): JsonValue {
|
function convertParameterValue(
|
||||||
|
value: string,
|
||||||
|
schema: JsonSchemaType,
|
||||||
|
): JsonValue {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
@ -92,11 +95,11 @@ export async function callTool(
|
||||||
// since we now accept pre-parsed values from the CLI
|
// since we now accept pre-parsed values from the CLI
|
||||||
const stringArgs: Record<string, string> = {};
|
const stringArgs: Record<string, string> = {};
|
||||||
for (const [key, value] of Object.entries(args)) {
|
for (const [key, value] of Object.entries(args)) {
|
||||||
if (typeof value === 'string') {
|
if (typeof value === "string") {
|
||||||
stringArgs[key] = value;
|
stringArgs[key] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(stringArgs).length > 0) {
|
if (Object.keys(stringArgs).length > 0) {
|
||||||
const convertedStringArgs = convertParameters(tool, stringArgs);
|
const convertedStringArgs = convertParameters(tool, stringArgs);
|
||||||
convertedArgs = { ...args, ...convertedStringArgs };
|
convertedArgs = { ...args, ...convertedStringArgs };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue