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

# Get Parent Agent State Function Context Variables

> Get context variables available to a parent agent state function.



## OpenAPI

````yaml /api-reference/openapi.json get /api/parent_agents/{parent_agent_id}/state_function/context_variables
openapi: 3.1.0
info:
  title: Maadify API
  description: Public and admin API endpoints for Maadify.
  version: 1.0.0
servers:
  - url: https://app.maadify.com
    description: Production
security: []
tags:
  - name: Parent agents
    description: Create, update, and configure parent agents.
  - name: Sub-agents
    description: Create sub-agents and assign them to parent agents.
  - name: Tools
    description: Search tools and manage tool assignments.
  - name: Prompt templates
    description: Search and manage prompt templates.
  - name: Users
    description: Search users available to the authenticated tenant.
  - name: Models
    description: Search available LLM models.
  - name: Files
    description: Check file upload status.
paths:
  /api/parent_agents/{parent_agent_id}/state_function/context_variables:
    get:
      tags:
        - Parent agents
      summary: Get Parent Agent State Function Context Variables
      description: Get context variables available to a parent agent state function.
      operationId: >-
        get_parent_agent_state_function_context_variables_api_parent_agents__parent_agent_id__state_function_context_variables_get
      parameters:
        - name: parent_agent_id
          in: path
          required: true
          schema:
            type: integer
            title: Parent Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StateFunctionContextVariablesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    StateFunctionContextVariablesResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether the request was successful.
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Type of error if the request failed.
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: Error message or informational message.
        data:
          $ref: '#/components/schemas/StateFunctionContextVariablesData'
          description: Parent agent state-function context variables.
      type: object
      required:
        - success
        - data
      title: StateFunctionContextVariablesResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StateFunctionContextVariablesData:
      properties:
        context_variables:
          items:
            $ref: '#/components/schemas/StateFunctionContextVariableGroup'
          type: array
          title: Context Variables
          description: Context variables available to state-function rules.
      type: object
      title: StateFunctionContextVariablesData
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    StateFunctionContextVariableGroup:
      properties:
        key:
          type: string
          title: Key
          description: Unique context source key.
        tool_key:
          type: string
          title: Tool Key
          description: Context source key used by tool-output references.
        tool_name:
          type: string
          title: Tool Name
          description: Source display name.
        display_name:
          type: string
          title: Display Name
          description: Human-readable source name.
        tool_id:
          type: string
          title: Tool Id
          description: Tool or source identifier.
        source_type:
          type: string
          title: Source Type
          description: >-
            Context source type, such as tool, sub_agent, runtime_input,
            trigger, or loop.
        variables:
          items:
            $ref: '#/components/schemas/StateFunctionContextVariable'
          type: array
          title: Variables
          description: Variables available from this context source.
        output_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output Schema
          description: JSON schema describing the source output.
      additionalProperties: true
      type: object
      required:
        - key
        - tool_key
        - tool_name
        - display_name
        - tool_id
        - source_type
      title: StateFunctionContextVariableGroup
    StateFunctionContextVariable:
      properties:
        path:
          type: string
          title: Path
          description: Path within the context source output.
          default: ''
        type:
          type: string
          title: Type
          description: Value type for the context variable.
          default: any
        description:
          type: string
          title: Description
          description: Variable description.
          default: ''
        full_var:
          type: string
          title: Full Var
          description: Jinja expression that references this context variable.
        insert_value:
          type: string
          title: Insert Value
          description: Raw path value to insert into state-function expressions.
      additionalProperties: true
      type: object
      required:
        - full_var
        - insert_value
      title: StateFunctionContextVariable
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````