Expand description
The built-in assistant: Claude answers engineers’ questions about the
PDM data, using the MCP tool set (mcp::tools) on the server.
Flow of one run: the question (a quick action or free text) becomes the
first user message; the server sends it with the tool definitions to the
model API (through the provider-neutral layer in crate::llm), runs
every tool call the model asks for with the rights of the signed-in user
and sends the results back, until the model answers or a limit (steps,
tokens, time) is reached.
- Enabled only when an API key (or a local server) is configured; the key never leaves the transport except in its request header.
- Read-only by default: the write tools (
create_change_draft,add_to_change,create_change_request,comment_change_request) are only offered when the request allows drafts. - No SDK: plain JSON over the existing
reqwestclient. The HTTP part sits behindllm::Transportand the tools behindTools, so the loop is tested without network or database.
The audit record of a run (who, which action, question length, tools –
no content) is written by services::assistant.
Structs§
- Answer
- The final answer of a run.
- Assistant
- The configured assistant of a server.
- Check
Line - One line of
teamcraft assistant check. - Limits
- Limits of one run.
- McpTools
- The MCP tools with the rights of
me. A run takes minutes, so every call uses the user’s rights as they are at that moment (a membership lost or a group restricted during the run applies to the next step). - Open
Link - A link the reply shows under the answer: “Open 3D preview”.
- Question
- One request to the assistant.
- ToolUse
- One tool call of a run, for the answer and the audit log.
- Trace
- What a run did so far – filled even when it fails or times out.
Enums§
- Action
- What the user asked for.
- Assistant
Error - Why a run failed.
Constants§
- MAX_
OPEN_ LINKS - Most “Open 3D preview” links under one answer.
- MAX_
QUESTION_ CHARS - Longest free question in characters.
- MAX_
RUN_ TOKENS - Most input + output tokens of one run, summed over all steps.
- MAX_
TOOL_ RESULT_ BYTES - Longest tool result handed to the model, in bytes.
- OPEN_
PREVIEW_ TOOL - The tool whose results carry an open hint.
- TAINTED_
WRITE - The answer of a text write tool once the run has read restricted content.
- TEXT_
WRITE_ TOOLS - Write tools that put free text into objects other users read.
Traits§
- Tools
- Runs one tool and returns its MCP
CallToolResult.
Functions§
- check
- Sends one small request with one tool and reports reachability, the key, the model, tool support and token counts. Never includes the key.
- open_
links - The links of a run’s open hints. A hint is model-reachable data, so its
URL is checked like untrusted input: only this server’s 3D viewer page of
a file (relative, or under
public_url) passes, as a relative path; anything else is dropped. Duplicates are shown once. - provider_
for - The wire format of a configured provider.
- render_
markdown - Renders the model’s markdown-lite as safe HTML: headings, lists, pipe
tables, code blocks, paragraphs,
codeand bold. All text is escaped; the only generated links point to items of this server. - run_
loop - Runs the tool loop until the model answers or a limit is reached.
- system_
prompt - The system prompt of a run.
- tool_
result_ text - The text of an MCP
CallToolResultand whether it is an error. - tool_
specs - The tools offered to the model: the MCP tool set, without the write tools unless drafts are allowed.