# `PhoenixKit.API.CoreTools`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v2.64.1/lib/phoenix_kit/api/core_tools.ex#L1)

The tools core itself provides, in the `system` namespace.

They need no module and no scope: every valid key may call them.
`system.get_identity` answers "who am I and what may I do" and is the first
thing to call when setting a key up; `system.get_approval` follows an
operation that waits for a person's approval.

# `get_approval`

```elixir
@spec get_approval(map(), map()) :: {:ok, map()} | {:error, atom(), String.t(), map()}
```

Handler of `system.get_approval`: the state of one of the calling key's approvals
(`PhoenixKit.API.Approvals.status_view/1`), or `not_found` for an id that does not
exist, is malformed, belongs to another key, or is not an approval.

# `get_identity`

```elixir
@spec get_identity(map(), map()) :: {:ok, map()} | {:error, atom(), String.t(), map()}
```

Handler of `system.get_identity`.

Returns `{:ok, map}` with `key` (`prefix`, `name`, `expires_at`,
`requires_approval`), `owner` (`id`, `email`, `service_user`), `scopes`
(the effective scopes) and `tools` (`name`, `scope`, `read_only` of every
tool they unlock).

# `tools`

```elixir
@spec tools() :: [PhoenixKit.API.Tool.t()]
```

The tools core declares; `PhoenixKit.API.Registry` adds them to every module's.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
