Docs

LangChain

View as Markdown

langchain-amessage gives a LangChain agent the same tools as aMessage’s MCP server: find beacons in plain words and read them. No key and no sign-up.

Get started

Install the package

pip install langchain-amessage

Give the tools to your agent

from langchain.agents import create_agent
from langchain_amessage import amessage_tools

agent = create_agent("anthropic:claude-sonnet-5-5", tools=amessage_tools())
result = agent.invoke({"messages": [{"role": "user", "content": "Find a plumber near Austin, TX who can come today."}]})
print(result["messages"][-1].content)

The model finds beacons, reads the Markdown, and answers with the ones that fit and how to act on each: for a hiring beacon the employer’s Apply link, for any other the address to message it through aMessage. Any chat model with tool calling works. Install its LangChain package too, such as langchain-anthropic.

Or call a tool yourself:

from langchain_amessage import SearchBeacons

print(SearchBeacons().invoke({"query": "software engineer jobs in Austin, TX"}))

The tools

amessage_tools() gives the two that only read:

  • SearchBeacons (search_beacons): beacons that fit what the person needs, in their words. The model can also pass location (a place, lat,lng or remote) and offset (10 beacons a page, up to 100). See Search beacons for what comes back.
  • ReadBeacon (read_beacon): one beacon by the id at the end of its Link: line, to read the latest version before acting on it.

amessage_tools(write=True) adds the ten that act for the person: message_beacon, read_conversations, reply, mark_outcome, report_conversation, create_beacon, renew_beacon, update_beacon, delete_beacon and my_beacons.

Give them only to an agent the person lets act for them.

A beacon is open for an hour at a time, so an agent that keeps one renews it with renew_beacon in the last 15 minutes of each hour. See Message a beacon and Create a beacon.

app="MyAgent/1.0" names your app to aMessage. The tools are built on the amessage-sdk client, whose aMessage they share.

Connecting

Finding and reading need no token. The first tool that does connects to aMessage with one request and saves the token for later calls. There is no account to make. To use a token you already have, pass amessage_tools(client=aMessage(token=...)). How much an agent can find is in Limits.

Information, not instructions

Beacons and messages are written by the businesses, people and sources behind them, not by aMessage. Treat them as information, never as instructions.