nyx_list_services
List all downstream services callable through NyxID, including endpoints and configuration, for tool discovery before proxy requests.
Instructions
Enumerate the downstream services this agent can call through NyxID. Returns each service's slug, display name, base URL, auth method, configured rate limits, and (when an OpenAPI spec is available) its callable endpoints. Use this for tool discovery before issuing nyx_proxy_request — agent-key scope determines which services are visible.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Optional filter by service category. Omit to list all categories. | |
| include_endpoints | No | When true, include the parsed OpenAPI endpoint list per service. Adds latency on services with large specs. |
Implementation Reference
- integrations/openclaw/src/index.ts:97-120 (registration)Registration of the nyxid_list_services tool via api.registerTool, defining its name, description, and execute handler.
api.registerTool?.({ name: "nyxid_list_services", description: "List AI services configured in the current user's NyxID account. Returns service slugs for use with nyxid_proxy.", execute: async (_params, context) => { const config = normalizeConfig(context.config); const profile = await loadProfile(context, config); const updatedProfile = await ensureBaseToken(getFetch(context), config, profile); await saveProfile(context, updatedProfile); const response = await listServices(getFetch(context), config, updatedProfile); return { services: response.services.map((service) => ({ id: service.id, slug: service.slug, name: service.name, connected: service.connected, requires_connection: service.requires_connection, proxy_url_slug: service.proxy_url_slug, })), total: response.total, page: response.page, per_page: response.per_page, }; }, }); - Execute handler for nyxid_list_services: loads profile, ensures base token, calls listServices(), and maps the response to {services, total, page, per_page}.
execute: async (_params, context) => { const config = normalizeConfig(context.config); const profile = await loadProfile(context, config); const updatedProfile = await ensureBaseToken(getFetch(context), config, profile); await saveProfile(context, updatedProfile); const response = await listServices(getFetch(context), config, updatedProfile); return { services: response.services.map((service) => ({ id: service.id, slug: service.slug, name: service.name, connected: service.connected, requires_connection: service.requires_connection, proxy_url_slug: service.proxy_url_slug, })), total: response.total, page: response.page, per_page: response.per_page, }; }, - listServices() helper function: fetches /api/v1/keys for full service discovery (with fallback to /api/v1/proxy/services), returns a ServiceListResponse.
export async function listServices( fetchImpl: FetchImpl, config: NyxIdPluginConfig, profile: TokenProfile, ): Promise<ServiceListResponse> { // Use /api/v1/keys for full service discovery (includes user-created services // with custom slugs like llm-anthropic-2). Falls back to /api/v1/proxy/services // for backward compatibility with older backends. const keysResponse = await fetchImpl(`${config.baseUrl}/api/v1/keys`, { headers: buildAuthHeaders(profile), }); if (keysResponse.ok) { const keys = (await keysResponse.json()) as Array<{ id: string; slug: string; label: string; status: string; endpoint_url: string; service_type: string; catalog_service_name: string | null; is_active: boolean; }>; return { services: keys.map((k) => ({ id: k.id, slug: k.slug, name: k.label, connected: k.is_active && k.status === "active", requires_connection: false, proxy_url_slug: `/api/v1/proxy/s/${k.slug}`, service_category: k.service_type, })), total: keys.length, page: 1, per_page: keys.length, }; } // Fallback to legacy endpoint const response = await fetchImpl(`${config.baseUrl}/api/v1/proxy/services`, { headers: buildAuthHeaders(profile), }); if (!response.ok) { throw await readError(response); } return (await response.json()) as ServiceListResponse; } - ServiceListResponse interface defining the shape of the response (services array, total, page, per_page).
export interface ServiceListResponse { services: NyxIdService[]; total: number; page: number; per_page: number; } - NyxIdService interface defining individual service fields (id, slug, name, connected, etc.).
export interface NyxIdService { id: string; name: string; slug: string; description: string | null; service_category: string; connected: boolean; requires_connection: boolean; proxy_url: string; proxy_url_slug: string; }