Skip to main content

Send one controlled Claw Messenger message from LangChain and prove the matching reply in the tool

Project description

Claw Messenger for LangChain

Use this package to send one controlled plain-text message from LangChain to a registered E.164 phone and prove the same thread works when the matching reply reaches the active tool invocation.

It is intentionally not a persistent inbound listener, webhook server, delivery guarantee, group-messaging tool, or general conversation store. An accepted, delivered, or read outbound status is not proof that the two-way setup works. The controlled reply must reach the tool before it returns proof_status: reply_received.

Install

Install the public package from PyPI:

python3 -m pip install langchain-claw-messenger

Credentials

Set your API key outside code, notebooks, screenshots, and logs:

export CLAW_API_KEY="cm_live_REDACTED"
export CONTROLLED_TEST_PHONE_E164="+14155550101"

For a release proof, use a regenerated key for a test tenant and revoke it when the run is complete.

Quick controlled proof

import os

from langchain_claw_messenger import create_claw_messenger_tool

tool = create_claw_messenger_tool()
result = tool.invoke(
    {
        "recipient_e164": os.environ["CONTROLLED_TEST_PHONE_E164"],
        "message": "This is my Claw Messenger test. Reply yes.",
        "timeout_seconds": 300,
    }
)
print(result)

The person holding the controlled phone must reply in the same thread while the tool is waiting. Count the run as successful only when the returned JSON includes:

{
  "proof_status": "reply_received",
  "reply_source": "controlled_recipient"
}

The named reply observation point for this proof is the active LangChain tool invocation. Do not count accepted, delivered, or read outbound status as reply proof.

Possible proof states are:

  • reply_received: the matching reply reached this tool invocation.
  • send_failed: Claw Messenger rejected or failed the outbound request.
  • reply_timeout: no matching reply reached this invocation before its deadline.
  • configuration_error: the key, recipient, message, or timeout was invalid.

In an async LangChain app, use await tool.ainvoke(...). The synchronous invoke path deliberately refuses to nest another event loop.

Agent use

Bind the returned StructuredTool to the LangChain model or agent runtime you already use:

tools = [create_claw_messenger_tool()]

# Bind `tools` to your existing LangChain model or agent runtime.
# Instruct the agent to use only a registered recipient and to call setup
# complete only when proof_status is reply_received.

The tool reads CLAW_API_KEY by default. You can instead pass api_key= at construction time, but never put a real key in source control.

Current scope

  • One plain-text outbound message to one registered E.164 recipient.
  • Truthful send.result status fields.
  • One matching inbound reply observed during the same tool call.
  • Sanitized message and chat identifier hints rather than raw identifiers.

The tool stops listening when it returns. Use your own long-running WebSocket consumer or webhook for persistent inbound handling.

Release verification

Each release must pass the same checks used by the n8n and CrewAI packages:

  1. Keep the package metadata and bundled LICENSE file on the approved Apache 2.0 license.
  2. Use package-scoped PyPI publisher access without placing credentials in the repository, examples, screenshots, or logs.
  3. Regenerate a test-tenant API key specifically for this proof. Never reuse a production key.
  4. Name one controlled registered E.164 phone, a person ready to reply, and the active LangChain tool invocation as the reply observation point.
  5. Build, test, check, and install the wheel in a clean virtual environment.
  6. Send one short plain-text message, then reply once from the controlled phone in the same thread while the tool is waiting.
  7. Retain only sanitized evidence showing proof_status: reply_received for the matching thread. Accepted, delivered, or read outbound status alone does not pass this gate.
  8. Revoke the regenerated test key.
  9. Publish only after explicit approval. Release notes and maintainer contact remain separate decisions.

Claw Messenger documentation: https://clawmessenger.com/docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_claw_messenger-0.1.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_claw_messenger-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file langchain_claw_messenger-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_claw_messenger-0.1.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for langchain_claw_messenger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a5873a295156f161ab23786bd32e4ee55ce67c33933e57448c91eab670853198
MD5 17a0800e888e7bcd4c27219ef7755000
BLAKE2b-256 ea6bb76eed966fdc401ed48a5026c0200d67a2c6c273195a261c6ede2f445e2e

See more details on using hashes here.

File details

Details for the file langchain_claw_messenger-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_claw_messenger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a118d588e7df427c57497ec96e631f1c8e756da3e7dbbba4957d05e8aa3073d
MD5 aa1e9fa97ce981bad887de308794da3f
BLAKE2b-256 b52ab9a1e6404781122310bd5465a2e3c09251d81cc21296137f3b17b96cde53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page