Skip to main content
Glama

login_as

Switch session identity to a teacher via Feishu open_id, so write operations like question recording are attributed to that teacher; expired tokens are automatically renewed.

Instructions

飞书机器人免密切身份(PRD-007):凭服务密钥用 open_id 换该 teacher 的 token,替换本会话身份。

用途:bot 后端按飞书消息发送者的 open_id 逐消息切身份,让写操作(录题/组卷等)归属各自 teacher。 鉴权:服务密钥走 env BOT_SECRET(只在机器人后端持有、不入 git);调用方不需密码。 401 自动重签:切身份后,后续工具遇 token 失效会按当前 open_id 自动重调 botLogin 重签(不走密码重登)。 参数: openid: 飞书 open_id(如 ou_xxx)。 返回: 成功 → {ok:true, user_id, openid}。 失败 → {ok:false, hint}:openid 未绑定 teacher → hint 含「未绑定」(bot 按此路由拒绝话术); BOT_SECRET 未配置 / 密钥错 / 账号停用等各有对应提示。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
openidYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description takes on the full burden of behavioral disclosure. It explains the authentication mechanism (BOT_SECRET, not requiring caller password), the side effect of replacing the session identity, and the automatic 401 retry behavior. The return structure also details success/error cases. It does not mention rate limits or idempotency, but overall it is sufficiently transparent.

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

Conciseness5/5

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

The description is well-structured with labeled sections (用途, 鉴权, 401自动重签, 参数, 返回). Every sentence contributes necessary context—purpose, authentication, retry behavior, parameters, and return values—without redundancy. It is front-loaded with the core purpose, making it easy for an AI agent to quickly grasp the tool's role.

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

Completeness5/5

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

Given the tool has a single parameter, an output schema effectively documented in the description, and behavioral details, the description is comprehensive. It covers all essential aspects: what the tool does, how authentication works, side effects, and what results to expect in success and failure cases. No significant gaps remain.

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

Parameters5/5

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

The input schema has 0% description coverage, but the description adds a clear definition for the sole parameter 'openid': it provides the type ('飞书 open_id') and an example ('ou_xxx'). This meaningfully supplements the schema, which only declares the parameter as a string without further explanation.

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

Purpose5/5

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

The description clearly states the tool is for identity switching in a Feishu bot using a service secret to exchange open_id for a teacher's token. It explicitly says it replaces the current session identity, and the '用途' section explains the per-message identity switching scenario. This distinguishes it from siblings like 'login' (presumably for initial authentication).

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

Usage Guidelines4/5

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

The '用途' section specifies that this tool is used on a per-message basis to make write operations belong to respective teachers. It also mentions that after switching, subsequent tools automatically handle token re‑issuance on 401. However, it does not explicitly state when NOT to use it or provide a direct comparison with 'login', leaving some ambiguity for the AI agent.

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

Install Server

Other Tools

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/RuntimeAll/teacher-mcp'

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