Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
search_ak_docsA

Full-text search across AK concepts, guides, guardrails, and API entries. Returns ranked results with resource URIs.

get_ak_apiA

Exact signature, parameters, return value, semantics, examples, and FATAL codes for an AK kernel function, macro, or type (e.g. 'timer_set', 'task_post_pure_msg').

list_ak_apiA

List AK kernel API symbols, optionally filtered by module (task, message, timer, fsm, tsm, ak, port), each with a one-line summary.

get_ak_guideA

Step-by-step recipe (with skeleton code, Makefile.mk steps, and wiring) for a common AK task. Topics: create-driver, create-screen, create-task, isr-bridge, tune-pools, use-timer.

get_ak_guardrailsA

The rules every AK contribution must follow: which directories are off-limits (kernel, boot, networks, common) and the kernel invariants (no blocking, fixed pools, 64-byte payload, max 7 refs, priority 0 reserved). Consult before generating code.

Prompts

Interactive templates invoked by user choice

NameDescription
ak-new-taskScaffold a new AK task following kernel conventions and guardrails.
ak-new-driverScaffold a new hardware-agnostic AK driver using function-pointer injection.

Resources

Contextual data attached and managed by the client

NameDescription
ak-indexList of every AK concept, guide, guardrail, and API resource.
Messages, Signals & PoolsThree fixed-size message pools (pure/common/dynamic) carry signals between tasks; messages are reference-counted and auto-freed after the handler returns.
AK Active Kernel — OverviewAK is a cooperative, event-driven kernel where tasks communicate only via messages carrying signals, driven by timers and structured as state machines.
The AK Scheduler & Task Modeltask_run() loops the scheduler then polling tasks; it dispatches the highest-priority ready message to a run-to-completion handler across 8 priority levels.
State Machines — FSM & TSMAK ships two state-machine styles — FSM (state is a function pointer) and TSM (table-driven states/transitions); both dispatch a message to the current state.
Software TimersSoftware timers post a signal to a task after a duty; one-shot or periodic, keyed by (task_id, sig), fed by timer_tick() from the hardware tick ISR.
Recipe: Create a new driverDrivers are hardware-agnostic modules using function-pointer injection; the BSP supplies the real GPIO, app code instantiates and wires them, and events enter the kernel via task_post_*.
Recipe: Create a new screenA screen is an FSM handler scr_xxx_handle(msg) reacting to SCREEN_ENTRY/EXIT and app signals, navigating with SCREEN_TRAN/SCREEN_BACK and drawing via view_render.
Recipe: Create a new taskFive steps to add an AK task — register an ID, add a table row with a priority, declare signals, implement the switch handler, and add the source to Makefile.mk.
Recipe: Bridge an interrupt to a taskAn ISR brackets its body with task_entry_interrupt()/task_exit_interrupt(), does minimal work, and posts a message to a task instead of processing in interrupt context.
Recipe: Size and tune the poolsRead the *_used_max() high-water-mark counters under a real workload, then size the message and timer pools in ak.cfg.mk with headroom.
Recipe: Use a software timerUse timer_set for periodic/one-shot signals, rely on (task_id,sig) re-arm semantics, and always cancel with timer_remove_attr to avoid late firing.
Guardrail: Kernel constraints & invariantsHard rules every AK task must respect — no blocking, run-to-completion, fixed pools, 64-byte common payload, max 7 refs, priority 0 reserved, 16 KB RAM budget.
Guardrail: Where to make changes (and where not to)Extend AK in app/ and driver/. Treat the kernel, bootloader, network stacks, and common framework as read-only unless explicitly asked.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/the-ak-foundation/mcp-docs-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server