chatlog_mcp: sharper tool descriptions to stop Gemini halting after list_chats
- list_chats output now ends with an explicit instruction to call chatlog_recent / chatlog_since next (Gemini 2.5 Flash tends to answer after a single tool call otherwise) - list_chats description: clarify it only returns metadata, never content - recent description: marked as PREFERRED for reading actual messages
This commit is contained in:
parent
2fa011fa2a
commit
97c2dae082
1 changed files with 24 additions and 8 deletions
|
|
@ -68,6 +68,15 @@ def _format_chats(payload: dict) -> str:
|
|||
f"- {c.get('title') or '(ohne Titel)'} "
|
||||
f"(id={c['chat_id']}, {c['message_count']} Nachrichten)"
|
||||
)
|
||||
lines.append("")
|
||||
lines.append(
|
||||
"WICHTIG: Diese Liste enthaelt nur Metadaten (Titel + Anzahl). "
|
||||
"Um die NACHRICHTEN selbst zu sehen, MUSST du jetzt zwingend einen "
|
||||
"zweiten Tool-Call machen: chatlog_recent(chat='<titel-substring>') "
|
||||
"fuer die letzten Nachrichten ODER "
|
||||
"chatlog_since(chat='<titel-substring>', hours=24) fuer alles seit "
|
||||
"den letzten 24h. Antworte NICHT bevor du das gemacht hast."
|
||||
)
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
|
|
@ -127,10 +136,12 @@ TOOLS = [
|
|||
{
|
||||
"name": "chatlog_list_chats",
|
||||
"description": (
|
||||
"List every Telegram group that the Arakawa Concierge logger "
|
||||
"is currently recording. Returns the chat title, internal id "
|
||||
"and message count. Always call this first when you don't yet "
|
||||
"know which group the user is asking about."
|
||||
"Returns ONLY the metadata (title, id, message count) of every "
|
||||
"Telegram group being recorded. Does NOT contain any messages. "
|
||||
"Use this only when you don't know which group the user means. "
|
||||
"After calling this you MUST make a second call to chatlog_recent "
|
||||
"or chatlog_since to actually read the messages — the user "
|
||||
"wants the conversation content, not just chat titles."
|
||||
),
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
|
|
@ -141,10 +152,15 @@ TOOLS = [
|
|||
{
|
||||
"name": "chatlog_recent",
|
||||
"description": (
|
||||
"Return the most recent messages of a recorded Telegram group "
|
||||
"as a chronological transcript. Use this for questions like "
|
||||
"'Was wurde zuletzt geschrieben?' or 'Aktueller Stand?'. "
|
||||
"If 'chat' is omitted, returns recent messages across all groups."
|
||||
"PREFERRED tool to actually READ the latest messages of a "
|
||||
"recorded Telegram group. Returns a chronological transcript "
|
||||
"with timestamps, senders and full message bodies. Use this "
|
||||
"for: 'Was wurde heute / zuletzt geschrieben?', 'Aktueller "
|
||||
"Stand im <Gruppe>-Chat?', 'Was hat <Person> gesagt?'. "
|
||||
"If you don't know the chat title, call chatlog_list_chats "
|
||||
"first and then ALWAYS follow up with this tool. "
|
||||
"If 'chat' is omitted, returns recent messages across all "
|
||||
"groups (works fine when only one group is recorded)."
|
||||
),
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue