# Properties

Canonical URL: https://developers.iagenify.com/sdk/ref/local-agent/properties/
Language: en

What the object carries, and which of it is live during a run.

Status: live while running · id before the first run · toolNames is what was selected

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `id` | string|null |  | The session identifier, set at creation when `memory` is on. `null` otherwise. |
| `model` | string |  | The agent's model. For which model served a turn, read the `turn` events. |
| `mode` | string |  | The mode in force. Changed with `setMode()`. |
| `title` | string |  | Taken from the first message of a session. |
| `usage` | object |  | `{ credits, turns, toolCalls }` — reset at the start of each run, subagents included. |
| `context` | object |  | `{ tokens, limit, window, cachedTokens, cleared, parts }`. |
| `todos` | array |  | The current plan. |
| `toolNames` | string[] |  | The tools this agent was given, custom ones included. |
| `library` | object |  | `{ skills, subagents }` — what the last run loaded. |
| `libraryStatus` | object |  | Why a library is empty, when it is. |
| `mcpServers` | array |  | The connected servers this run may use. |
| `machine · files · shell` | object |  | What it was given. |

## What changes during a run {#live}

```javascript
const running = agent.run({ message: "…" });

const timer = setInterval(() => {
  console.log(agent.usage.credits, "credits ·", agent.context.tokens, "tokens");
}, 1000);

await running;
clearInterval(timer);
```

`usage`, `context`, `todos` and `library` are all updated as the loop goes. Events are the better channel — they carry the same numbers at the moment they change — but polling works.

## usage is per run {#usage-resets}

> **It is reset at the start of every run**
>
> It is not a running total for the agent object. Keep your own sum across runs if you need the conversation's whole cost.

## context, field by field {#context-shape}

| Field | Is |
| --- | --- |
| `tokens` | The last turn's size, as the provider measured it |
| `limit` | The limit in force |
| `window` | The model's own window, or `null` if the catalogue could not be read |
| `cachedTokens` | What the provider served from cache |
| `cleared` | How many tool results have been emptied |
| `parts` | `{ system, tools, memory, messages }` |

## toolNames is what was selected, not what is declared {#toolnames}

A tool that cannot run on this machine — `bash` with no shell on a phone — is already out of it. `skill` and `task` appear only once a library has something in it, so they are not in this list before the first run.

- [Events](/sdk/agent/events): The same numbers, pushed.
- [Context](/sdk/agent/context): What the parts mean.
- [LocalAgent](/sdk/ref/local-agent): Every property and method.

```python
import threading

done = threading.Event()

def watch():
    while not done.wait(1):
        print(agent.usage["credits"], "credits ·", agent.context["tokens"], "tokens")

threading.Thread(target=watch, daemon=True).start()
agent.run(message="…")
done.set()
```
