Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GAM_TIMEZONENoOptional. IANA time-zone name choosing which calendar dates are requested. Does not change the zone GAM counts days in (reports always use timeZoneSource: PUBLISHER). Default: the network's own time zone. An unrecognized IANA name or a raw UTC offset (e.g. +08:00) stops startup with exit code 2.
GAM_HTTP_PORTNoOptional. When set, the MCP listens for Streamable-HTTP requests on this port at POST /mcp (with GET /healthz for probes) instead of stdio. Digits only, 1–65535. An invalid port, or a port already in use by another process, stops startup with exit code 2. Default: off — stdio mode.
GAM_LOG_LEVELNoOptional. One of error, warn, info, debug. Logs are JSON-lines on stderr — tool calls, GAM retries, report-job lifecycle, cache hits. Credentials are never logged. Default: info.
GAM_PAGE_ROWSNoOptional. Rows returned per page of report results, clamped to 10000 (values above the cap are used as 10000 and logged once as config.page_rows_clamped). A value that isn't a positive integer stops startup. Replaces GAM_INLINE_ROW_THRESHOLD, which is no longer read.
GAM_NETWORK_CODEYesRequired. Numeric Google Ad Manager network code. A missing or non-numeric value stops startup with exit code 2.
GAM_REPORT_CACHE_DIRNoOptional. When set, stores a reference to each report result (report name, result name, row count, run time — never rows) as one JSON file per entry at <dir>/<network code>/<64-character hex definition hash>.json, in a directory created with mode 0o700. Survives MCP restarts. Default: off — in-memory only.
GAM_HTTP_BEARER_TOKENNoOptional. HTTP mode only. When set, every request to /mcp must carry Authorization: Bearer <token>; a missing or wrong token is refused 401. /healthz skips this check. Leaving it unset logs http.unauthenticated once at startup and serves every /mcp request with no authentication.
GAM_REPORT_TIMEOUT_MSNoOptional. Max time to poll one report job, in milliseconds — digits only (3e5, 5.0, -1, " 5" all stop startup). Default: 300000. Set it below your MCP client's call timeout. On timeout the GAM job is not abandoned; the next identical call resumes the same operation.
GAM_HTTP_ALLOWED_HOSTSNoOptional. HTTP mode only. Comma-separated list of host names (no ports). A request whose Host header names anything else is refused 403, checked before the bearer token. Default: off — no Host check.
GAM_SAVED_QUERIES_FILENoOptional. Path to the saved-query JSON store used by save_query / run_saved_query. stdio mode only — HTTP mode does not register the saved-query tools. Default: ${XDG_CONFIG_HOME:-$HOME/.config}/gam-mcp/saved-queries.json.
GAM_REPORT_CACHE_TTL_MSNoOptional. How long a cached result reference is reused, in milliseconds — applies to both the in-memory and disk tiers. 0 disables result reuse entirely. Default: 3600000 (1h).
GAM_SERVICE_ACCOUNT_KEY_FILENoOne-of credential source. Absolute path to a service-account JSON key file. Wins over GAM_SERVICE_ACCOUNT_KEY_JSON if both are set.
GAM_SERVICE_ACCOUNT_KEY_JSONNoOne-of credential source. Service-account JSON inline, either as raw text or base64-encoded. Useful in hosted environments where mounting a key file is awkward. Eagerly parsed at startup — a malformed value fails fast.
GOOGLE_APPLICATION_CREDENTIALSNoCredential fallback. If neither GAM_SERVICE_ACCOUNT_KEY_FILE nor GAM_SERVICE_ACCOUNT_KEY_JSON is set, the server falls back to Application Default Credentials — this variable, a `gcloud auth application-default login` token, or the GCE/Cloud Run metadata server.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription

No tools

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources