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

# Definições das ferramentas

> As ferramentas de navegação em JSON Schema de função, prontas para qualquer LLM.



## OpenAPI

````yaml openapi/pt/cell.json GET /v1/history/tools
openapi: 3.1.0
info:
  title: API de dados da Niadra
  version: '1'
  description: >-
    Escrita, contexto, histórico, objetos, identidade, privacidade e governança
    de um espaço. Cada espaço tem um endereço estável, com o espaço e a região
    no nome.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: O espaço, que vem na chave de fonte.
      region:
        default: us-east-1
        description: A região do espaço, que também vem na chave.
security: []
paths:
  /v1/history/tools:
    get:
      tags:
        - read
      summary: Definições das ferramentas
      description: >-
        As três ferramentas de navegação (`search_customer_history`,
        `get_customer_timeline`, `open_history_item`) em JSON Schema de chamada
        de função. As descrições dizem ao modelo quando chamar cada uma e quando
        a resposta já está no contexto. O cliente nunca é argumento de
        ferramenta: amarre no seu código (o `tools()` do SDK faz isso) ou com um
        `subject_token`.


        **Autenticação.** Chave de fonte: `Authorization: Bearer nia_sk_...`.
        Escopo exigido: `search`.
      operationId: tools_v1_history_tools_get
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ToolDefinition'
                title: Response Tools V1 History Tools Get
                type: array
              example:
                tools:
                  - type: function
                    function:
                      name: search_customer_history
                      description: >-
                        Search everything that happened with this customer.
                        Check "From the history" in the context first.
                      parameters:
                        type: object
                        properties:
                          query:
                            type: string
                        required:
                          - query
          description: >-
            As definições. Texto estável, para continuarem no começo do prompt
            que fica em cache.
      security:
        - sourceKey: []
      x-codeSamples:
        - lang: python
          label: Python
          source: >-
            # The customer is bound here, outside the model's reach

            kit = niadra.tools(phone("+14155550123"),
            conversation_id="call-4471")


            reply = llm.chat.completions.create(
                model=MODEL,
                messages=messages,
                tools=kit.definitions,
            )

            for call in reply.choices[0].message.tool_calls or []:
                output = kit.call(call.function.name, call.function.arguments)
                messages.append({"role": "tool", "tool_call_id": call.id, "content": output})
        - lang: typescript
          label: TypeScript
          source: >-
            // The customer is bound here, outside the model's reach

            const kit = niadra.tools(handles.phone("+14155550123"), {
            conversation_id: "call-4471" });


            const reply = await llm.chat.completions.create({ model: MODEL,
            messages, tools: kit.definitions });

            for (const call of reply.choices[0].message.tool_calls ?? []) {
              const output = await kit.call(call.function.name, call.function.arguments);
              messages.push({ role: "tool", tool_call_id: call.id, content: output });
            }
components:
  schemas:
    ToolDefinition:
      additionalProperties: false
      description: >-
        A definição de uma ferramenta de chamada de função, no formato JSON
        Schema mais difundido.
      properties:
        function:
          additionalProperties: true
          title: Function
          type: object
          description: '`name`, `description` e `parameters` (JSON Schema).'
        type:
          const: function
          default: function
          title: Type
          type: string
      required:
        - function
      title: ToolDefinition
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````