Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,36 @@ require (
github.com/antlr4-go/antlr/v4 v4.13.1
github.com/getsentry/sentry-go v0.35.1
github.com/gkampitakis/go-snaps v0.5.14
github.com/mark3labs/mcp-go v0.41.1
github.com/sergi/go-diff v1.4.0
github.com/spf13/cobra v1.10.1
github.com/stretchr/testify v1.11.1
)

require (
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gkampitakis/ciinfo v0.3.3 // indirect
github.com/gkampitakis/go-diff v1.3.2 // indirect
github.com/goccy/go-yaml v1.18.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/jsonschema v0.13.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/maruel/natural v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.2.0 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/text v0.29.0 // indirect
Expand Down
21 changes: 21 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/getsentry/sentry-go v0.35.1 h1:iopow6UVLE2aXu46xKVIs8Z9D/YZkJrHkgozrxa+tOQ=
github.com/getsentry/sentry-go v0.35.1/go.mod h1:C55omcY9ChRQIUcVcGcs+Zdy4ZpQGvNJ7JYHIoSWOtE=
github.com/gkampitakis/ciinfo v0.3.3 h1:28PgAHtW3wG7UCAKuCK+17rBib9iqtLjajuWsVLUPQY=
Expand All @@ -19,15 +25,24 @@ github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/invopop/jsonschema v0.13.0 h1:KvpoAJWEjR3uD9Kbm2HWJmqsEaHt8lBUpd0qHcIi21E=
github.com/invopop/jsonschema v0.13.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mark3labs/mcp-go v0.41.1 h1:w78eWfiQam2i8ICL7AL0WFiq7KHNJQ6UB53ZVtH4KGA=
github.com/mark3labs/mcp-go v0.41.1/go.mod h1:T7tUa2jO6MavG+3P25Oy/jR7iCeJPHImCZHRymCn39g=
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
Expand All @@ -43,6 +58,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
Expand All @@ -63,6 +80,10 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b h1:DXr+pvt3nC887026GRP39Ej11UATqWDmWuS99x26cD0=
Expand Down
15 changes: 15 additions & 0 deletions internal/analysis/diagnostic_kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ func SeverityToAnsiString(s Severity) string {
}
}

func SeverityToString(s Severity) string {
switch s {
case ErrorSeverity:
return "Error"
case WarningSeverity:
return "Warning"
case Information:
return "Info"
case Hint:
return "Hint"
default:
return utils.NonExhaustiveMatchPanic[string](s)
}
}

type DiagnosticKind interface {
Message() string
Severity() Severity
Expand Down
22 changes: 22 additions & 0 deletions internal/cmd/mcp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cmd

import (
"github.com/formancehq/numscript/internal/mcp_impl"
"github.com/spf13/cobra"
)

var mcpCmd = &cobra.Command{
Use: "mcp",
Short: "Run the mcp server",
Hidden: true,
RunE: func(cmd *cobra.Command, args []string) error {
err := mcp_impl.RunServer()
if err != nil {
cmd.SilenceErrors = true
cmd.SilenceUsage = true
return err
}

return nil
},
}
1 change: 1 addition & 0 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func Execute(options CliOptions) {
rootCmd.Version = options.Version

rootCmd.AddCommand(lspCmd)
rootCmd.AddCommand(mcpCmd)
rootCmd.AddCommand(checkCmd)
rootCmd.AddCommand(getTestCmd())
rootCmd.AddCommand(getRunCmd())
Expand Down
195 changes: 195 additions & 0 deletions internal/mcp_impl/handlers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
package mcp_impl

import (
"context"
"fmt"
"math/big"
"strings"

"github.com/formancehq/numscript/internal/analysis"
"github.com/formancehq/numscript/internal/interpreter"
"github.com/formancehq/numscript/internal/parser"
"github.com/mark3labs/mcp-go/mcp"
"github.com/mark3labs/mcp-go/server"
)

func parseBalancesJson(balancesRaw any) (interpreter.Balances, *mcp.CallToolResult) {
balances, ok := balancesRaw.(map[string]any)
if !ok {
return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Expected an object as balances, got: <%#v>", balancesRaw))
}

iBalances := interpreter.Balances{}
for account, assetsRaw := range balances {
if iBalances[account] == nil {
iBalances[account] = interpreter.AccountBalance{}
}

assets, ok := assetsRaw.(map[string]any)
if !ok {
return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Expected nested object for account %v", account))
}

for asset, amountRaw := range assets {
amount, ok := amountRaw.(float64)
if !ok {
return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Expected float for amount: %v", amountRaw))
}

n, _ := big.NewFloat(amount).Int(new(big.Int))
iBalances[account][asset] = n
}
Comment on lines +33 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Amounts parsing risks precision loss and silently truncates fractions. Enforce integer semantics and accept safe types.

  • Converting via big.NewFloat(amount).Int ignores fractional parts and float64 precision limits (money correctness risk).
  • Validate integer-ness, reject NaN/Inf, and optionally accept string integers.

Apply:

-    for asset, amountRaw := range assets {
-      amount, ok := amountRaw.(float64)
-      if !ok {
-        return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Expected float for amount: %v", amountRaw))
-      }
-
-      n, _ := big.NewFloat(amount).Int(new(big.Int))
-      iBalances[account][asset] = n
-    }
+    for asset, amountRaw := range assets {
+      var n *big.Int
+      switch v := amountRaw.(type) {
+      case float64:
+        if math.IsNaN(v) || math.IsInf(v, 0) {
+          return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Invalid number for amount at %s/%s: %v", account, asset, v))
+        }
+        if v != math.Trunc(v) {
+          return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Amount must be an integer at %s/%s, got: %v", account, asset, v))
+        }
+        if v > float64(math.MaxInt64) || v < float64(math.MinInt64) {
+          return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Amount out of 64-bit range at %s/%s: %v", account, asset, v))
+        }
+        n = big.NewInt(int64(v))
+      case string:
+        n = new(big.Int)
+        if _, ok := n.SetString(v, 10); !ok {
+          return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Invalid integer string for amount at %s/%s: %q", account, asset, v))
+        }
+      default:
+        return interpreter.Balances{}, mcp.NewToolResultError(fmt.Sprintf("Expected integer (number or string) for amount at %s/%s, got: %T", account, asset, amountRaw))
+      }
+      iBalances[account][asset] = n
+    }

Additionally, add import:

@@
-import (
+import (
   "context"
   "fmt"
+  "math"
   "math/big"
   "strings"

Committable suggestion skipped: line range outside the PR's diff.

}
return iBalances, nil
}

func parseVarsJson(varsRaw any) (map[string]string, *mcp.CallToolResult) {
vars, ok := varsRaw.(map[string]any)
if !ok {
return map[string]string{}, mcp.NewToolResultError(fmt.Sprintf("Expected an object as vars, got: <%#v>", varsRaw))
}

iVars := map[string]string{}
for key, rawValue := range vars {

value, ok := rawValue.(string)
if !ok {
return map[string]string{}, mcp.NewToolResultError(fmt.Sprintf("Expected stringified var, got: %v", key))
}
Comment on lines +55 to +58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix error message: report the offending value/type, not the key.

-    value, ok := rawValue.(string)
-    if !ok {
-      return map[string]string{}, mcp.NewToolResultError(fmt.Sprintf("Expected stringified var, got: %v", key))
-    }
+    value, ok := rawValue.(string)
+    if !ok {
+      return map[string]string{}, mcp.NewToolResultError(fmt.Sprintf("Variable %q must be a string, got: %T", key, rawValue))
+    }
🤖 Prompt for AI Agents
In internal/mcp_impl/handlers.go around lines 55 to 58, the error message
currently reports the key when the cast to string fails; change it to report the
offending value and its type instead. Replace the fmt.Sprintf argument so it
includes rawValue and reflect.TypeOf(rawValue) (or use %T) in the message, e.g.
"Expected stringified var, got value=%v (type=%T)", rawValue, rawValue, and
return that in mcp.NewToolResultError.


iVars[key] = value
}

return iVars, nil
}

func addEvalTool(s *server.MCPServer) {
tool := mcp.NewTool("evaluate",
mcp.WithDescription("Evaluate a numscript program"),
mcp.WithIdempotentHintAnnotation(true),
mcp.WithReadOnlyHintAnnotation(true),
mcp.WithOpenWorldHintAnnotation(false),
mcp.WithString("script",
mcp.Required(),
mcp.Description("The numscript source"),
),
mcp.WithObject("balances",
mcp.Required(),
mcp.Description(`The accounts' balances. A nested map from the account name, to the asset, to its integer amount.
For example: { "alice": { "USD/2": 100, "EUR/2": -42 }, "bob": { "BTC": 1 } }
`),
),
mcp.WithObject("vars",
mcp.Required(),
mcp.Description(`The stringified variables to be passed to the script's "vars" block.
For example: { "acc": "alice", "mon": "EUR 100" } can be passed to the following script:
vars {
monetary $mon
account $acc
}

send $mon (
source = $acc
destination = @world
)
`),
),
)
s.AddTool(tool, func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
script, err := request.RequireString("script")
if err != nil {
return mcp.NewToolResultError(err.Error()), nil
}

parsed := parser.Parse(script)
if len(parsed.Errors) != 0 {
out := make([]string, len(parsed.Errors))
for index, err := range parsed.Errors {
out[index] = err.Msg
}
mcp.NewToolResultError(strings.Join(out, ", "))
}

balances, mcpErr := parseBalancesJson(request.GetArguments()["balances"])
if mcpErr != nil {
return mcpErr, nil
}

vars, mcpErr := parseVarsJson(request.GetArguments()["vars"])
if mcpErr != nil {
return mcpErr, nil
}

out, iErr := interpreter.RunProgram(
ctx,
parsed.Value,
vars,
interpreter.StaticStore{
Balances: balances,
},
map[string]struct{}{},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll add feature flags in future releases

)
if iErr != nil {
mcp.NewToolResultError(iErr.Error())
}
return mcp.NewToolResultJSON(*out)
})
}

func addCheckTool(s *server.MCPServer) {
tool := mcp.NewTool("check",
mcp.WithDescription("Check a program for parsing error or static analysis errors"),
mcp.WithIdempotentHintAnnotation(true),
mcp.WithReadOnlyHintAnnotation(true),
mcp.WithOpenWorldHintAnnotation(false),
mcp.WithString("script",
mcp.Required(),
mcp.Description("The numscript source"),
),
)

s.AddTool(tool, func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
script, err := request.RequireString("script")
if err != nil {
return mcp.NewToolResultError(err.Error()), nil
}

checkResult := analysis.CheckSource(script)

var errors []any
for _, d := range checkResult.Diagnostics {
errors = append(errors, map[string]any{
"kind": d.Kind.Message(),
"severity": analysis.SeverityToString(d.Kind.Severity()),
"span": d.Range,
})
}

return mcp.NewToolResultJSON(map[string]any{
"errors": errors,
})
})
}

func RunServer() error {
// Create a new MCP server
s := server.NewMCPServer(
"Numscript",
"0.0.1",
server.WithToolCapabilities(false),
server.WithRecovery(),
server.WithInstructions(`
You're a numscript expert AI assistant. Numscript is a DSL that allows modelling finantial transaction in an easy and declarative way. Numscript scripts alwasy terminate.
`),
Comment on lines +181 to +183
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typos in instructions string.

Correct spelling/grammar to avoid user-facing nits:

-    server.WithInstructions(`
-    You're a numscript expert AI assistant. Numscript is a DSL that allows modelling finantial transaction in an easy and declarative way. Numscript scripts alwasy terminate.
-    `),
+    server.WithInstructions(`
+    You're a Numscript expert AI assistant. Numscript is a DSL that allows modeling financial transactions in an easy and declarative way. Numscript scripts always terminate.
+    `),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
server.WithInstructions(`
You're a numscript expert AI assistant. Numscript is a DSL that allows modelling finantial transaction in an easy and declarative way. Numscript scripts alwasy terminate.
`),
server.WithInstructions(`
You're a Numscript expert AI assistant. Numscript is a DSL that allows modeling financial transactions in an easy and declarative way. Numscript scripts always terminate.
`),
🤖 Prompt for AI Agents
In internal/mcp_impl/handlers.go around lines 182 to 184, the instruction string
contains typos and grammar errors; replace the existing text with a corrected
sentence such as: "You are a Numscript expert AI assistant. Numscript is a DSL
that models financial transactions in an easy, declarative way. Numscript
scripts always terminate." Ensure spelling (Numscript, financial, always) and
punctuation are fixed and the string remains wrapped as a single
server.WithInstructions(...) argument.

// TODO add prompt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add a more complete prompt in future releases

)
addEvalTool(s)
addCheckTool(s)

// Start the server
if err := server.ServeStdio(s); err != nil {
return err
}

return nil
}