> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get function schema

> Returns what a function takes and gives back: its input variables, its output variables, and its exit paths, read from the environment's draft. Call it before executing to learn the input names.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json get /v1/stable/function/{functionID}/schema
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/function/{functionID}/schema:
    get:
      tags:
        - Function
      summary: Get function schema
      description: "Returns what a function takes and gives back: its input variables,
        its output variables, and its exit paths, read from the environment's
        draft. Call it before executing to learn the input names."
      operationId: StableFunctionController_getSchema
      parameters:
        - name: functionID
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: The ID of the function whose schema to read.
          description: The ID of the function whose schema to read.
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
        - name: environmentAlias
          required: true
          in: query
          schema:
            type: string
            description: The alias of the environment to operate on (e.g. `main`).
      responses:
        "200":
          description: Returns the function's inputs, output variables, and exit path names.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableFunctionSchemaReadResponse"
          x-vf-doc:
            description: Returns the function's inputs, output variables, and exit path
              names.
      security:
        - token: []
components:
  schemas:
    StableFunctionSchemaReadResponse:
      type: object
      properties:
        inputs:
          type: array
          items:
            $ref: "#/components/schemas/StableExecuteInput"
          description: The inputs execute takes, one per input variable, sorted by name.
            Every one is a required string.
        outputs:
          type: array
          items:
            $ref: "#/components/schemas/StableFunctionSchemaOutput"
          description: The output variables the function may return, sorted by name.
        paths:
          type: array
          items:
            type: string
          description: "The exit path names the function may return with `next: { path }`,
            in path order."
      required:
        - inputs
        - outputs
        - paths
    StableExecuteInput:
      type: object
      properties:
        name:
          type: string
          description: The input name, used as its key in `inputs` when executing.
        type:
          type: string
          description: The JSON type the value must have, such as `string`, `number` or
            `boolean`. Always `string` for a function or an API tool, and `any`
            when an MCP tool does not say.
        required:
          type: boolean
          description: Whether execute needs a value for this input.
        description:
          nullable: true
          description: What the input holds, as the tool describes it.
          type: string
      required:
        - name
        - type
        - required
        - description
    StableFunctionSchemaOutput:
      type: object
      properties:
        name:
          type: string
          description: The output variable name, a key of `outputVars`.
        description:
          nullable: true
          description: What the output variable holds, as written on the function.
          type: string
      required:
        - name
        - description
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
