Skip to main content
Glama

Set an app's OpenAI key

cometchat_set_openai_key
Destructive

Saves the OpenAI API key the app's AI features use, replacing any existing key. Only use a key the user gave you; it is never returned.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "app_id": "<app_id>",
      "openai_key": "<openai_key>"
    },
    "name": "cometchat_set_openai_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
app_idYesThe CometChat App ID (from cometchat_list_apps).
confirmNoSet true only after the user has explicitly agreed to this change. On a local connection that is enough; on the hosted server this change needs approval_code from the user's browser instead, and confirm is ignored.
openai_keyYesOpenAI API key, starting with sk-
approval_codeNoThe code the user got after approving this exact change in their browser. Only ever from the user; never make one up or reuse one for different arguments.

Output Schema

NameRequiredDescriptionDefault
app_idYesApp ID
openai_key_setYesAlways true when the call succeeds

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds meaningful behavior beyond annotations: it discloses that an existing key is destroyed ('replacing any existing key'), consistent with destructiveHint=true, and that the secret is never echoed back ('it is never returned'), which is critical for a credential-handling tool. It does not mention the approval/confirm gating, but that is fully documented in the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, zero filler, with the destructive overwrite stated up front followed by the safety constraint. Very efficient, though 'the app's AI features use' is slightly indirect phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need no explanation, and the schema carries the approval_code/confirm mechanics. The description covers the destructive nature and secret-handling rule; only the hosted-vs-local approval path is left entirely to the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so app_id, openai_key, confirm, and approval_code are already documented in structured fields, including the approval workflow nuance. The description adds no parameter-specific meaning beyond the schema, which is the baseline 3 case.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Saves'), resource ('OpenAI API key'), and scope ('the app's AI features use'), plus the overwrite behavior. It is distinct enough from siblings like cometchat_create_api_key or cometchat_update_app_settings, but it never explicitly contrasts itself with them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives one real constraint — 'Only use a key the user gave you' — which bounds behavior, but offers no when-to-use vs. when-not guidance and never points to alternative tools for related configuration tasks (e.g., set_feature, update_app_settings). Usage is implied rather than directed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.