ADK for TypeScript: API Reference
    Preparing search index...

    Class OperationParser

    Parses an OpenAPI OperationObject and extracts its parameters, request body, and return value.

    It maps OpenAPI parameters and request bodies into a flat list of ApiParameter objects that are compatible with Gemini's tool function declarations.

    Constructors

    • Parameters

      • operation: string | Record<string, unknown> | {}

        The operation to parse. A string is parsed as JSON, and a plain object is used as given.

      • options: { preservePropertyNames?: boolean; shouldParse?: boolean } = {}
        • OptionalpreservePropertyNames?: boolean

          Keeps the original parameter and function names instead of converting them to snake_case.

        • OptionalshouldParse?: boolean

          Whether to parse the operation during construction. Defaults to true.

      Returns OperationParser

    Methods

    • Gets the name of the security scheme this operation declares.

      Only operation-level security is considered. Document-level security is not visible from here, so a caller that needs the fallback uses OpenApiSpecParser instead.

      Returns string

      The first declared scheme name, or '' when the operation declares none.

    • Generates a Python-style docstring describing the operation, every parameter and the return value.

      The type names inside it are Python's, because the artifact is a docstring in adk-python's format and the same text reaches the model in both SDKs.

      Returns string

      The generated docstring.