Retool Prompt Assistance (LLM Rules?)

I don't have a developer background and have been building with Retool for the past 18 months alongside chatGPT. Lots of copy/paste and learning a ton, but get tripped up sometimes on specific Retool nuance that the LLM doesn't understand and is probably very trivial for even a beginner developer.

Biggest example - the LLM never seems to anticipate the structure of Retool queries which probably wasted hours and hours (days?) of trial/error.... so I finally put a snippet in Raycast that I paste in with most requests -

Retool structures as object of arrays

{
"id": [
"1",
"2",
"3"],
"some_column": [
"x",
"y",
"z"]
}

I'm embarrassed to admit how much this has helped... and there must be other nuances that I don't even know are slowing me down.

I'm wondering if anyone has put together a list of these that might be willing to share? It seems like you could create a Cursor-style Rules file for Retool that I could give to Claude to enhance the Retool-specific guidance I'm getting back

Hey @Mike_DeKock,

I wrote a slightly related post here Which AI tool for code assist - #2 by MiguelOrtiz

Something that helps me a lot is having the json editor available in the app so that I can make reference to any component and data source and copy paste it to the llm so that it knows what is the data target and goal structure.

With regards to REtool queries, I have made a habit of applying return formatDataAsArray (data) to all of my database queries, it just makes it so much easier for JS and any llm related questoin.

Hopefully the retool team are able to deploy an MCP that we're able to load to claude or openai so that it has tools to understand table's structures, js and transformers, etc.

2 Likes

Great question, @Mike_DeKock. :slightly_smiling_face: This is a bit tangential, but one quick tip for reformatting your query results into something more logical and/or readable is to utilize the formatDataAsArray helper function.

This transforms your data from what you shared above to the structure shown below.

[
  { id: 1, some_column: 'x' },
  { id: 2, some_column: 'y' },
  { id: 3, some_column: 'z' }
]

The other thing I'll add is that we are currently working on quite a few AI integrations, including an LLM assistant that "knows" how to work within the Retool environment. I look forward to being able to share more!