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: agent-workflow, create-driver, create-screen, create-task, debug-uart-shell, isr-bridge, kernel-task-log, start-project, 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.

start_ak_projectA

Begin a new firmware project from the AK base kit. Resolves the LATEST ak-base-kit-stm32l151 release (or a given tag) and returns the exact commands to download, extract, and lay out the project, plus the steps to customize it. Call this when an engineer wants to start/create/bootstrap a new AK-based project.

analyze_ak_logA

Paste raw UART console output from an AK board (boot logs, -SIG-> traces, FATAL banners, fatal l/fatal m dumps, timing lines) and get a structured diagnosis: detected FATAL codes with cause and fix, run-to-completion/starvation timing issues, reboot-loop detection, and the exact shell commands to run next.

decode_ak_lcdA

See the board's OLED screen headlessly: paste the raw output of the shell command lcd d (the 0xNN,0xNN,... framebuffer dump) and get the screen rendered as text art plus a PNG image, with content stats. Format: 128x64 @ 1bpp, page-major, LSB = top pixel (Adafruit_oled_drv).

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.
ak-new-projectDownload the latest ak-base-kit-stm32l151 release and customize it for the engineer.
ak-debugGuided debugging: capture the UART console, drive the shell, and diagnose with analyze_ak_log.

Resources

Contextual data attached and managed by the client

NameDescription
ak-indexList of every AK concept, guide, guardrail, and API resource.
AK_VERSION#define AK_VERSION "1.3"
AK_ENABLE#define AK_ENABLE (0x01)
AK_DISABLE#define AK_DISABLE (0x00)
AK_FLAG_ON#define AK_FLAG_ON (0x01)
AK_FLAG_OFF#define AK_FLAG_OFF (0x00)
AK_RET_OK#define AK_RET_OK (0x01)
AK_RET_NG#define AK_RET_NG (0x00)
AK_SYS_DEFINE_SIG#define AK_SYS_DEFINE_SIG (0)
AK_USER_DEFINE_SIG#define AK_USER_DEFINE_SIG (10)
TASK_PRI_MAX_SIZE#define TASK_PRI_MAX_SIZE (8)
TASK_PRI_LEVEL_0#define TASK_PRI_LEVEL_0 (0)
TASK_PRI_LEVEL_1#define TASK_PRI_LEVEL_1 (1)
TASK_PRI_LEVEL_2#define TASK_PRI_LEVEL_2 (2)
TASK_PRI_LEVEL_3#define TASK_PRI_LEVEL_3 (3)
TASK_PRI_LEVEL_4#define TASK_PRI_LEVEL_4 (4)
TASK_PRI_LEVEL_5#define TASK_PRI_LEVEL_5 (5)
TASK_PRI_LEVEL_6#define TASK_PRI_LEVEL_6 (6)
TASK_PRI_LEVEL_7#define TASK_PRI_LEVEL_7 (7)
AK_TASK_INTERRUPT_ID#define AK_TASK_INTERRUPT_ID (0xEE)
AK_TASK_IDLE_ID#define AK_TASK_IDLE_ID (0xEF)
LOG_QUEUE_OBJECT_SIZE#define LOG_QUEUE_OBJECT_SIZE (512)
LOG_QUEUE_IRQ_SIZE#define LOG_QUEUE_IRQ_SIZE (128)
task_pri_ttypedef uint8_t task_pri_t
task_id_ttypedef uint8_t task_id_t
pf_tasktypedef void (*pf_task)(ak_msg_t*)
pf_task_pollingtypedef void (*pf_task_polling)()
task_ttypedef struct { task_id_t id; task_pri_t pri; pf_task task; } task_t
task_polling_ttypedef struct { task_id_t id; uint8_t ability; pf_task_polling task_polling; } task_polling_t
exception_info_ttypedef struct { uint32_t except_number; uint32_t timestamp; } exception_info_t
task_createRegister the application's task table; must be terminated by an AK_TASK_EOT_ID sentinel row.
task_postLow-level primitive to enqueue a message you built by hand to a task; the kernel owns and frees it afterwards.
task_post_pure_msgPost a signal-only message (no payload) to a task - the cheapest and most common way to trigger a task.
task_post_common_msgPost a message with a small inline payload (≤ 64 B) copied into a common-pool message.
task_post_dynamic_msgPost a message with a variable/large heap-allocated payload; avoid in ISRs.
task_remove_msguint8_t task_remove_msg(task_id_t task_id, uint8_t sig)
task_initint task_init()
task_runEnter the kernel's infinite scheduler loop; dispatches ready messages then polling tasks. Never returns.
task_polling_createvoid task_polling_create(task_polling_t* task_polling_tbl)
task_polling_set_abilityEnable or disable a polling task at runtime.
task_polling_runvoid task_polling_run()
task_entry_interruptCall first in any ISR that touches the kernel; pairs with task_exit_interrupt to bracket the handler.
task_exit_interruptvoid task_exit_interrupt()
task_selftask_id_t task_self()
get_current_task_idtask_id_t get_current_task_id()
get_current_task_infotask_t* get_current_task_info()
get_current_active_objectak_msg_t* get_current_active_object()
task_irq_io_entry_triggervoid task_irq_io_entry_trigger()
task_irq_io_exit_triggervoid task_irq_io_exit_trigger()
task_pri_queue_dumpvoid task_pri_queue_dump()
AK_MSG_NULL#define AK_MSG_NULL ((ak_msg_t*)0)
AK_MSG_NG#define AK_MSG_NG (0)
AK_MSG_OK#define AK_MSG_OK (1)
AK_COMMON_MSG_POOL_SIZE#define AK_COMMON_MSG_POOL_SIZE (8)
AK_COMMON_MSG_DATA_SIZE#define AK_COMMON_MSG_DATA_SIZE (64)
AK_PURE_MSG_POOL_SIZE#define AK_PURE_MSG_POOL_SIZE (32)
AK_DYNAMIC_MSG_POOL_SIZE#define AK_DYNAMIC_MSG_POOL_SIZE (8)
AK_DYNAMIC_DATA_POOL_SIZE#define AK_DYNAMIC_DATA_POOL_SIZE (128)
AK_DYNAMIC_PDU_SIZE#define AK_DYNAMIC_PDU_SIZE (4)
AK_MSG_TYPE_MASK#define AK_MSG_TYPE_MASK (0xC0)
AK_MSG_REF_COUNT_MASK#define AK_MSG_REF_COUNT_MASK (0x3F)
AK_MSG_REF_COUNT_MAX#define AK_MSG_REF_COUNT_MAX (7)
get_msg_ref_count#define get_msg_ref_count(x) ((((ak_msg_t*)x)->ref_count) & AK_MSG_REF_COUNT_MASK)
reset_msg_ref_count#define reset_msg_ref_count(x) ((((ak_msg_t*)x)->ref_count) = (((ak_msg_t*)x)->ref_count) & (~AK_MSG_REF_COUNT_MASK))
get_msg_type#define get_msg_type(x) ((((ak_msg_t*)x)->ref_count) & AK_MSG_TYPE_MASK)
set_msg_sig#define set_msg_sig(m, s) (((ak_msg_t*)m)->sig = s)
set_msg_src_task_id#define set_msg_src_task_id(m, t) (((ak_msg_t*)m)->src_task_id = t)
set_msg_des_task_id#define set_msg_des_task_id(m, t) (((ak_msg_t*)m)->des_task_id = t)
set_if_src_task_id#define set_if_src_task_id(m, t) (((ak_msg_t*)m)->if_src_task_id = t)
set_if_des_task_id#define set_if_des_task_id(m, t) (((ak_msg_t*)m)->if_des_task_id = t)
set_if_src_type#define set_if_src_type(m, t) (((ak_msg_t*)m)->if_src_type = t)
set_if_des_type#define set_if_des_type(m, t) (((ak_msg_t*)m)->if_des_type = t)
set_if_sig#define set_if_sig(m, s) (((ak_msg_t*)m)->if_sig = s)
set_if_data_common_msg#define set_if_data_common_msg(m, d, s) set_data_common_msg(m, d, s)
set_if_data_dynamic_msg#define set_if_data_dynamic_msg(m, d, s) set_data_dynamic_msg(m, d, s)
PURE_MSG_TYPE#define PURE_MSG_TYPE (0x80)
COMMON_MSG_TYPE#define COMMON_MSG_TYPE (0xC0)
DYNAMIC_MSG_TYPE#define DYNAMIC_MSG_TYPE (0x40)
dbg_handler_ttypedef struct { uint32_t start_post; uint32_t start_exe; uint32_t stop_exe; } dbg_handler_t
ak_msg_ttypedef struct ak_msg_t { struct ak_msg_t* next; dbg_handler_t dbg_handler; uint8_t src_task_id; uint8_t des_task_id; uint8_t ref_count; uint8_t sig; uint8_t if_src_task_id; uint8_t if_des_task_id; uint8_t if_src_type; uint8_t if_des_type; uint8_t if_sig; } ak_msg_t
ak_msg_common_ttypedef struct { ak_msg_t msg_header; uint8_t len; uint8_t data[AK_COMMON_MSG_DATA_SIZE]; } ak_msg_common_t
ak_msg_pure_ttypedef struct { ak_msg_t msg_header; } ak_msg_pure_t
ak_msg_dynamic_ttypedef struct { ak_msg_t msg_header; uint32_t len; uint8_t* data; } ak_msg_dynamic_t
ak_msg_if_header_ttypedef struct { uint8_t type; uint8_t src_task_id; uint8_t des_task_id; uint8_t sig; uint8_t if_src_type; uint8_t if_des_type; } __AK_PACKETED ak_msg_if_header_t
ak_msg_pure_if_ttypedef struct { ak_msg_if_header_t header; } ak_msg_pure_if_t
ak_msg_common_if_ttypedef struct { ak_msg_if_header_t header; uint8_t len; uint8_t data[AK_COMMON_MSG_DATA_SIZE]; } __AK_PACKETED ak_msg_common_if_t
ak_msg_dynamic_if_ttypedef struct { ak_msg_if_header_t header; uint32_t len; uint8_t *data; } __AK_PACKETED ak_msg_dynamic_if_t
msg_initvoid msg_init()
msg_freevoid msg_free(ak_msg_t* msg)
msg_force_freevoid msg_force_free(ak_msg_t* msg)
msg_inc_ref_countKeep a message alive past a single delivery (for fan-out); max reference count is 7.
msg_dec_ref_countvoid msg_dec_ref_count(ak_msg_t* msg)
ak_mallocvoid* ak_malloc(size_t)
ak_freevoid ak_free(void*)
get_pure_msgak_msg_t* get_pure_msg()
get_pure_msg_pool_useduint32_t get_pure_msg_pool_used()
get_pure_msg_pool_used_maxuint32_t get_pure_msg_pool_used_max()
get_common_msgAllocate a common-pool message (with a 64-byte inline buffer); returns a ready message with ref_count 1. Never NULL.
get_common_msg_pool_useduint32_t get_common_msg_pool_used()
get_common_msg_pool_used_maxuint32_t get_common_msg_pool_used_max()

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