use polyc_llm::ToolSpec;
use serde_json::json;
pub const TOOL_NAME: &str = "unlink_identity";
pub const ALL: &[&str] = &[TOOL_NAME];
pub const ARG_TARGET_USER_ID: &str = "target_user_id";
#[must_use]
pub fn all_specs() -> Vec<ToolSpec> {
vec![unlink_identity_spec()]
}
#[must_use]
pub fn unlink_identity_spec() -> ToolSpec {
ToolSpec::new(
TOOL_NAME,
"For an admin only: remove ONE specific linked PLATFORM identity (a Slack, Telegram, \
or other provider account) from whatever persona it belongs to, leaving every other \
identity and the persona itself untouched. Use it when an admin asks to unlink, \
disconnect, or remove one specific linked platform account — for example \"unlink \
@heavygweit\", \"remove that test Slack handle\", or \"remove U0PERSONADEMO2 from my \
persona\" — as opposed to removing someone's access entirely (that's revoke), or \
removing the CALLER's OWN linked email or wallet (that's unlink_self, not this tool). \
Pass the target's real platform \
user id: verbatim from mention markup (`<@U...>`) when the message names them that \
way, or the literal id itself when the admin types it out directly (e.g. a seeded \
test identity with no real Slack member to mention) — but NEVER a display name or \
handle you would have to resolve or guess into an id. This refuses to unlink an \
identity that is the only way its persona is reachable (unlink would leave zero \
identities) — use revoke instead if the intent is to remove that persona's access \
entirely. If the person asking isn't an admin, it returns a refusal rather than \
unlinking anything.",
json!({
"type": "object",
"properties": {
ARG_TARGET_USER_ID: {
"type": "string",
"description": "The target's provider-native platform user id — verbatim \
from mention markup (`<@U...>`) when present, or the literal id as \
typed by the admin. Never a display name or handle to resolve or guess."
}
},
"required": [ARG_TARGET_USER_ID],
"additionalProperties": false
}),
)
.titled("Unlink one identity from its persona (admin)")
}