Skip to main content
Glama
BiteFoundry Teams MCP Server

BiteFoundry Teams MCP Server

search_messages

Read-onlyIdempotent

Search locally cached Microsoft Teams messages by body, subject, or sender via SQLite full-text search; scope by conversation, channel, or title, and fetch recent history first if not cached.

Instructions

Full-text search cached messages locally using SQLite FTS5 (no Microsoft Graph request). Only finds messages already fetched into cache.db; call get_messages first if recent history is not cached yet. Returns { query, hits }.

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": {
      "query": "<query>"
    },
    "name": "search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of search hits to return (1..1000, default 50).
queryYesFull-text search query (matches cached message body, subject, and sender).
targetNoOptional cached conversation conv_key, "Team/Channel", or unique title substring to scope the search.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of search hits to return (1..1000, default 50)."
    • addedInput schema / properties / query / description
      Added value: +"Full-text search query (matches cached message body, subject, and sender)."
    • changedInput schema / properties / target / description
      Previous value: -"Optional conversation target to restrict search."New value: +"Optional cached conversation conv_key, \"Team/Channel\", or unique title substring to scope the search."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so safety needs no restating. The description adds value beyond them by disclosing the cache-only limitation (no Microsoft Graph request) and the return shape { query, hits }, which tells the agent results may be stale or incomplete.

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?

Three short sentences, front-loaded with the core capability, then the cache caveat, then the return shape. Nothing is redundant or padding.

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?

For a 3-parameter read tool with no output schema, the description covers mechanism, precondition, fallback tool, and return shape. There is nothing material an agent would need to call it correctly that 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%, so limit, query fields, and target scoping are already documented in the schema. The description only restates that results are 'hits' and does not elaborate on how target resolves different identifier forms. Baseline 3 is appropriate when the schema carries the parameter burden.

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 (full-text search over cached messages) plus the mechanism (SQLite FTS5, no Graph request), which immediately separates it from network-backed siblings like get_messages. An agent knows exactly what this returns without opening the 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?

Explicitly names the prerequisite (messages must already be fetched into cache.db) and routes the agent to the concrete alternative, get_messages, for uncached history. This is the when-to-use guidance the dimension asks for, tied to a named sibling.

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