/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { Config } from '../config/config.js'; import type { ToolInvocation, ToolResult } from './tools.js'; import { BaseDeclarativeTool } from './tools.js'; /** * Parameters for the Query API tool * Used to search API documentation for specific endpoints, fields, and methods * Supports English and Chinese queries for finding API information */ export interface QueryApiToolParams { /** * Service name to search within (e.g., "group", "order", "user") * Must not contain spaces or special characters except hyphens and underscores. * Valid characters: alphanumeric characters, hyphens, underscores, and Chinese characters. * Invalid characters: spaces, < > : " | ? * and other special characters. */ service_name: string; /** * Optional: operation keyword to filter specific API methods (e.g., "保存", "分页查询", "create", "list") * This matches against the API description to find specific operations * Must not contain special characters that could cause security issues. */ operation_keyword?: string; } /** * Implementation of the Query API tool * This tool is designed specifically for LLMs to query API documentation * It can identify user intent, automatically query API documentation stored in * path.join(config.storage.getGeminiDir(), 'api'), and return structured field information. */ export declare class QueryApiTool extends BaseDeclarativeTool { private readonly config; static readonly Name: string; constructor(config: Config); /** * Validates the parameters for the QueryApiTool. * @param params The parameters to validate * @returns An error message string if validation fails, null if valid */ protected validateToolParamValues(params: QueryApiToolParams): string | null; protected createInvocation(params: QueryApiToolParams): ToolInvocation; }