Skip to main content
Glama

Search Linkedin Message History

search_linkedin_message_history
Read-only

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results (default 50, max 200). Only override if the user says a specific number like "show me 10 messages". For vague quantities ("couple", "few", "recent"), omit this parameter to use the default.
offsetNoRows to skip for paging (default 0). When the result is truncated, re-call with offset += limit to fetch the next page.
order_byNoSQL ORDER BY clause (default: message_datetime DESC).message_datetime DESC
as_teammateNoRead a consented teammate's LinkedIn message history instead of your own — pass their email. Gated on that teammate's conversation-sharing setting; a teammate who hasn't shared is rejected. Omit for your own.
where_clauseYesSQL WHERE clause (without WHERE keyword). Use ONLY these columns: provider, chat_id, sender_name, sender_provider_id, recipient_name, recipient_provider_id, content, message_datetime, reply_outcome (inbound replies only; '' / 'interested' / 'meeting_booked' / 'not_interested' — the reply's classified outcome). To check whether a prior conversation exists before firing a templated message, match on `sender_provider_id`/`recipient_provider_id` first; if that returns zero rows, run a second pass matching the person's full name (first AND last) as a substring, e.g. `sender_name ILIKE '%Jane%Doe%' OR recipient_name ILIKE '%Jane%Doe%'`, before concluding there's no history — a stored provider_id is often blank or wrong, so an exact-match zero is indistinguishable from "never messaged." Never match on first name alone (it pulls every same-first-name person in the inbox and risks dropping a cold message onto a stranger's live thread). The full-name pass is a substring match, so if it spans more than one person (different provider_ids), use only the thread whose counterpart is your recipient — don't merge look-alike names or reuse a mismatched `chat_id`. Even both passes empty isn't proof of no prior contact: this local store holds only a bounded initial backfill from around when the account was connected, forward, so an older or pre-connection thread may never have been ingested — and the same person may be stored under a variant name a substring match misses. When you have the counterpart's `provider_id` and need certainty, call `fetch_linkedin_messages_with_person` — it reads LinkedIn's full synced history live and writes it back here; if that also returns empty, treat "no history" as confirmed, otherwise flag the uncertainty when a cold-open template goes to approval.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Read-only status is already covered by readOnlyHint, but the description adds substantial non-obvious behavioral context: content is truncated to 1000 chars, the local store holds only a bounded initial backfill so an empty result is not proof of no contact, and as_teammate is gated on the teammate's sharing setting. This exceeds what annotations provide.

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?

The summary/returns structure is front-loaded and each clause is informative rather than filler. Slightly dense, but the trimming would lose the disambiguation and truncation facts, so the length is largely earned.

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?

Covers the return shape inline (count, truncated, messages, chat_id hand-off), the data-completeness caveat, the teammate-sharing gate, and the alternative tool. For a read-only search tool with no output schema, nothing an agent needs to call it correctly is missing.

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 description coverage is 100%, and the description's parameter-relevant content (column names, chat_id reuse) is largely duplicated from or delegated to the schema. With the structured fields doing the heavy lifting, baseline 3 is appropriate.

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?

States a specific verb and resource ('Search the user's LinkedIn message history (synced conversations)') and immediately disambiguates from the sibling 'fetch_linkedin_messages_with_person' by explaining which artifact each returns. An agent can distinguish this local-store search from the live-history fetch without opening either schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance ('call this once per person (loop in run_code)') and a concrete escalation path: when the counterpart's provider_id is known and certainty is required, use fetch_linkedin_messages_with_person instead. It also documents the join to setup_linkedin_sequence for follow-ups, so the routing decision is fully specified.

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.

Resources