@letta-ai/letta-code 0.31.9 → 0.31.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.31.9",
3
+ "version": "0.31.11",
4
4
  "description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.10",
@@ -2,7 +2,7 @@
2
2
  "src/agent/client-skills.test.ts": 1134,
3
3
  "src/agent/memory-git.ts": 2090,
4
4
  "src/backend/local-backend.test.ts": 2532,
5
- "src/backend/local/local-backend.ts": 1014,
5
+ "src/backend/local/local-backend.ts": 1012,
6
6
  "src/backend/local/local-store.ts": 3459,
7
7
  "src/backend/pi-stream-adapter.test.ts": 1304,
8
8
  "src/cli/app/AppCoordinator.tsx": 5188,
@@ -23,7 +23,7 @@
23
23
  "src/cli/subcommands/skills.ts": 1264,
24
24
  "src/headless.ts": 4994,
25
25
  "src/hooks/integration.test.ts": 1147,
26
- "src/index.ts": 2775,
26
+ "src/index.ts": 2773,
27
27
  "src/mods/learning-harness.ts": 2434,
28
28
  "src/mods/mod-engine.test.ts": 2153,
29
29
  "src/mods/mod-engine.ts": 1838,
@@ -44,7 +44,6 @@
44
44
  "src/websocket/listener/file-commands.ts": 1053,
45
45
  "src/websocket/listener/lifecycle.ts": 1048,
46
46
  "src/websocket/listener/protocol-inbound.ts": 2207,
47
-
48
47
  "src/websocket/listener/protocol-outbound.ts": 1047,
49
48
  "src/websocket/listener/turn.ts": 1058
50
49
  }
@@ -9,13 +9,23 @@ When the user appears upset with the agent, acknowledge the problem and ask whet
9
9
 
10
10
  If the user says yes, or directly asks you to submit feedback:
11
11
 
12
- 1. Write a short factual message in the user's voice. Include what happened, what the user expected, and any useful error or behavior detail already present in the conversation. Do not add claims the user did not make.
13
- 2. Submit it with:
12
+ 1. Gather the relevant context already available in the conversation and environment. If a detail essential to understanding or reproducing the problem is missing, ask the user one focused question before submitting. Do not invent missing details.
13
+ 2. Write a concise, factual report in your own voice as the agent. Do not impersonate the user or make the report sound user-authored. The first line must disclose: `Agent-submitted feedback on behalf of the user.`
14
+
15
+ Include:
16
+ - Your agent name.
17
+ - Who you are working with (the user's name or role, if known; otherwise say `user not identified`).
18
+ - The task or goal underway when the problem occurred and enough surrounding context to understand why it mattered.
19
+ - What actually happened, what the user expected, and the impact on the task.
20
+ - Concrete evidence already available, such as exact error text, the failed command or action, relevant paths or links, and reliable reproduction steps. Distinguish what the user reported from what you observed or inferred.
21
+
22
+ Prefer specific nouns and observable behavior over generic judgments. Do not submit context-free summaries such as “the feature is broken,” “the UX should be improved,” or polished product-language filler. Keep unknowns explicit rather than guessing.
23
+ 3. Submit it with:
14
24
 
15
25
  ```bash
16
26
  letta feedback --message '<feedback>'
17
27
  ```
18
28
 
19
- 3. Tell the user whether submission succeeded. If it failed, report the safe CLI error and do not claim the team received it.
29
+ 4. Tell the user whether submission succeeded. If it failed, report the safe CLI error and do not claim the team received it.
20
30
 
21
31
  Do not include secrets, credentials, unrelated conversation content, or private file contents. The command adds the current agent and conversation identifiers so the team can find the relevant run.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: using-mcp-tools
3
+ description: Reference for the `letta mcp` CLI, which finds and invokes MCP tools available to this agent. A system reminder already lists your connected MCP servers and the basic search/schema/call commands; invoke this skill when you need more — browsing a server's tools, passing large or file-based arguments, tuning search, or troubleshooting missing servers, tools, and errors.
4
+ ---
5
+
6
+ # Using MCP tools
7
+
8
+ `letta mcp` gives the agent one unified view of every MCP server it can reach: servers connected to the agent in Letta Cloud and servers configured locally on this machine. It works from any surface where the agent runs — cloud sandboxes (chat.letta.com), Letta Desktop, and terminals. All output is JSON.
9
+
10
+ ## Commands
11
+
12
+ ```bash
13
+ letta mcp list # servers: [{name, transport}]
14
+ letta mcp get <server> # one server's connection configuration (credentials redacted)
15
+ letta mcp tools [server] # tool names + descriptions only
16
+ letta mcp tools [server] --full # ...including every tool's complete schema
17
+ letta mcp schema <tool-name> # one tool's complete schema
18
+ letta mcp search <query> [--mode] [--limit] # ranked tool schemas: [{tool, rank, score}]
19
+ letta mcp call <tool-name> [--args | --args-file] # run a tool, print a CallToolResult
20
+ ```
21
+
22
+ Every command accepts `--agent <id>`, defaulting to `LETTA_AGENT_ID`/`AGENT_ID` — do not pass it unless targeting another agent.
23
+
24
+ ## Search options
25
+
26
+ - `--mode <hybrid|vector|fts>` — default `hybrid`. `vector` uses server-side embeddings and covers only cloud-connected servers; `fts` and `hybrid` also rank local tools lexically. Agents on a local backend cannot use `vector`.
27
+ - `--limit <n>` — result count, 1-100 (default 5).
28
+ - Rank order is meaningful; absolute scores are not comparable across queries. When even the top results look unrelated to the query, no relevant tool likely exists — do not force the best-ranked one.
29
+
30
+ ## Call arguments and results
31
+
32
+ - `--args '<json>'` — inline JSON object.
33
+ - `--args-file <path>` — read the JSON object from a file; `--args-file -` reads stdin. Use these for large or shell-quoting-hostile payloads.
34
+ - Output is an MCP CallToolResult: `content` (array of typed blocks), optional `structuredContent`, and `isError`.
35
+ - Exit codes: `0` success, `1` CLI/usage error (JSON on stderr: `{error: {code, message, hint?}}`), `2` the tool ran and returned an error result — read `content` for the server's message, fix the arguments, and retry.
36
+ - Summarize relevant results instead of pasting large raw payloads.
37
+
38
+ ## Troubleshooting
39
+
40
+ - `list` empty → no MCP servers are available. Ask the user to connect one on the Letta Cloud MCP servers page or configure a local one in the Letta Code app.
41
+ - Cloud server with no tools (or `0 tools` in the reminder) → tools were never synced. Ask the user to resync it from the MCP servers page; the CLI has no refresh action.
42
+ - `unauthorized` or another auth error on `call` → the server's stored credentials are missing or stale (`tools` can still list from previously synced rows). Ask the user to re-authenticate the server: cloud servers on the MCP servers page, local OAuth servers by connecting once in the Letta Code app — this CLI is non-interactive and only reuses persisted credentials.
43
+ - `ambiguous_server_name` → two servers share a name; the error hint explains how to disambiguate.
44
+ - Duplicate tool names across servers get a numeric suffix (`_2`); the printed name is always the callable one.
@@ -1,37 +0,0 @@
1
- ---
2
- name: using-cloud-mcp
3
- description: Uses MCP servers connected to the current Letta Cloud agent (cloud MCP). Load when the user asks to use a connected MCP server, list the agent's MCP servers or MCP tools, run an MCP tool connected in ADE/chat, or mentions cloud MCP, server-side MCP, agent MCP, or `letta cloud-mcp`.
4
- ---
5
-
6
- # Using Cloud MCP
7
-
8
- Letta Cloud stores MCP server connections per agent. The `letta cloud-mcp` CLI lists and runs those servers' tools through the Letta API, so it works from any surface where the agent runs: cloud sandboxes (chat.letta.com), Letta Desktop, and terminals.
9
-
10
- ## Workflow
11
-
12
- 1. List MCP servers connected to this agent:
13
-
14
- ```bash
15
- letta cloud-mcp list
16
- ```
17
-
18
- 2. Pick the relevant `id` from the JSON output, then list its tools:
19
-
20
- ```bash
21
- letta cloud-mcp tools <mcp-server-id>
22
- ```
23
-
24
- 3. Pick a tool `id`, inspect its name and description, and run it with a JSON object:
25
-
26
- ```bash
27
- letta cloud-mcp run <mcp-server-id> <tool-id> --args '{"key":"value"}'
28
- ```
29
-
30
- ## Rules
31
-
32
- - Do not ask for an agent ID unless the user wants another agent. The CLI reads `LETTA_AGENT_ID`/`AGENT_ID` from the environment.
33
- - Treat command output as JSON. Summarize relevant results instead of pasting large raw payloads.
34
- - If `list` is empty, ask the user to connect an MCP server to the agent on the MCP servers page.
35
- - If `tools` is empty for a connected server, the server's tools were never synced. Ask the user to resync the server from the MCP servers page; the CLI has no refresh action.
36
- - If a connected server has type `stdio`, its tools cannot run on hosted Letta Cloud. Tell the user instead of retrying.
37
- - This requires a signed-in Letta Cloud agent. MCP servers configured locally in the terminal (`/mcp`) are unrelated to this CLI.