lt.insight
lt.insight sends natural-language prompts to an LLM that works with the connected MCP servers. It answers queries, builds YAML workflows from a description, refines them from feedback, and describes them. Requires an LLM API key. See MCP.
mcpQuery
Section titled “mcpQuery”const result = await lt.insight.mcpQuery({ prompt: 'Find all open issues labeled bug', tags: ['github'], wait: true,});Run a natural-language query against the connected MCP servers.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | The query |
tags |
string[] |
No | Tags that scope which MCP servers are used |
wait |
boolean |
No | true waits for the result; otherwise the call returns once the query starts |
direct |
boolean |
No | true queries the LLM directly, outside workflow orchestration |
context |
any |
No | Extra context forwarded to the LLM |
Returns: LTApiResult<any>
Auth: Optional. The userId is forwarded to the query pipeline when provided.
buildWorkflow
Section titled “buildWorkflow”const result = await lt.insight.buildWorkflow({ prompt: 'Screenshot a URL, analyze the image, and store results in a spreadsheet', tags: ['browser', 'vision', 'sheets'], wait: true,});Generate a YAML workflow from a natural-language description.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | Description of the workflow |
tags |
string[] |
No | Tags that scope the available MCP tools |
wait |
boolean |
No | true waits for generation to finish |
feedback |
string |
No | Feedback on a previous generation |
prior_yaml |
string |
No | YAML from a previous generation |
answers |
any |
No | Answers to clarifying questions from a prior round |
prior_questions |
any |
No | Questions from a prior round, for context |
Returns: LTApiResult<any>
Auth: Optional. The userId is forwarded to the builder when provided.
refineWorkflow
Section titled “refineWorkflow”const result = await lt.insight.refineWorkflow({ prompt: 'Screenshot and analyze a URL', prior_yaml: existingYaml, feedback: 'Add a retry step if the screenshot fails', wait: true,});Refine an existing YAML workflow with feedback.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | Original description |
prior_yaml |
string |
Yes | The YAML workflow to refine |
feedback |
string |
Yes | The changes to make |
tags |
string[] |
No | Tags that scope the available MCP tools |
wait |
boolean |
No | true waits for refinement to finish |
Returns: LTApiResult<any>
Auth: Optional. The userId is forwarded to the builder when provided.
describeWorkflow
Section titled “describeWorkflow”const result = await lt.insight.describeWorkflow({ prompt: 'Take a screenshot of a URL and analyze it with a vision model',});Generate a readable description and tags for a workflow.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | The workflow prompt or content to describe |
result_title |
string |
No | Title from the workflow result, for context |
result_summary |
string |
No | Summary from the workflow result, for context |
Returns: LTApiResult<{ description: string, tags: string[] }>
Auth: Not required.
