From d1d140e464e4d53dd329c01e77bddebc84323fad Mon Sep 17 00:00:00 2001 From: Hein Date: Thu, 2 Apr 2026 16:36:15 +0200 Subject: [PATCH] fix(tools): add hint for project_not_found error --- internal/tools/helpers.go | 1 + llm/memory.md | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/tools/helpers.go b/internal/tools/helpers.go index 5fef029..0048c55 100644 --- a/internal/tools/helpers.go +++ b/internal/tools/helpers.go @@ -87,6 +87,7 @@ func resolveProject(ctx context.Context, db *store.DB, sessions *session.ActiveP Type: mcperrors.TypeProjectNotFound, Field: "project", Project: projectRef, + Hint: fmt.Sprintf("project %q does not exist yet; call create_project with name=%q first, then retry", projectRef, projectRef), }, ) } diff --git a/llm/memory.md b/llm/memory.md index f6ff996..df4bda1 100644 --- a/llm/memory.md +++ b/llm/memory.md @@ -33,6 +33,15 @@ After setting the active project: 3. Apply all returned skills and guardrails immediately and for the duration of the session. 4. Only generate or define new skills and guardrails if none are returned. If you do create new ones, store them with `add_skill` or `add_guardrail` and link them to the project with `add_project_skill` or `add_project_guardrail` so they persist for future sessions. +## Project Does Not Exist Yet + +If any tool returns a `project_not_found` error: + +1. Call `create_project` with the same name you tried to use. +2. Immediately retry the original tool call with that project. + +Do not abandon the project scope or retry without a project. The project simply needs to be created first. + ## Project Memory Rules - Use project memory for code decisions, architecture, TODOs, debugging findings, and context specific to the current repo or workstream. @@ -85,4 +94,4 @@ Notes are returned by `describe_tools` in future sessions. Annotate whenever you ## Short Operational Form -At the start of every session, call `describe_tools` to read the full tool list and any accumulated usage notes. Use AMCS memory in project scope when the current work matches a known project; if no clear project matches, global notebook memory is allowed for non-project-specific information. At the start of every project session call `list_project_skills` and `list_project_guardrails` and apply what is returned; only create new skills or guardrails if none exist. If your MCP client does not preserve sessions across calls, pass `project` explicitly instead of relying on `set_active_project`. Store durable notes with `capture_thought`. For binary files or files larger than 10 MB, call `upload_file` with `content_path` to stage the file and get an `amcs://files/{id}` URI, then pass that URI to `save_file` as `content_uri` to link it to a thought. For small files, use `save_file` or `upload_file` with `content_base64` directly. Browse stored files with `list_files`, and load them with `load_file` only when their contents are needed. Stored files can also be read as raw binary via MCP resources at `amcs://files/{id}`. Never store project-specific memory globally when a matching project exists, and never store memory in the wrong project. If project matching is ambiguous, ask the user. Whenever you discover a non-obvious tool behaviour, gotcha, or workflow pattern, record it with `annotate_tool` so future sessions benefit. +At the start of every session, call `describe_tools` to read the full tool list and any accumulated usage notes. Use AMCS memory in project scope when the current work matches a known project; if no clear project matches, global notebook memory is allowed for non-project-specific information. At the start of every project session call `list_project_skills` and `list_project_guardrails` and apply what is returned; only create new skills or guardrails if none exist. If your MCP client does not preserve sessions across calls, pass `project` explicitly instead of relying on `set_active_project`. Store durable notes with `capture_thought`. For binary files or files larger than 10 MB, call `upload_file` with `content_path` to stage the file and get an `amcs://files/{id}` URI, then pass that URI to `save_file` as `content_uri` to link it to a thought. For small files, use `save_file` or `upload_file` with `content_base64` directly. Browse stored files with `list_files`, and load them with `load_file` only when their contents are needed. Stored files can also be read as raw binary via MCP resources at `amcs://files/{id}`. Never store project-specific memory globally when a matching project exists, and never store memory in the wrong project. If project matching is ambiguous, ask the user. If a tool returns `project_not_found`, call `create_project` with that name and retry — never drop the project scope. Whenever you discover a non-obvious tool behaviour, gotcha, or workflow pattern, record it with `annotate_tool` so future sessions benefit.