Skip to main content
Glama
dpdanpittman

mcp-server-quint

by dpdanpittman

quint_parse

Parse Quint specification code to generate JSON-formatted intermediate representation for AST inspection and error detection.

Instructions

Parse a Quint spec and return the intermediate representation (IR) as JSON. Useful for inspecting the AST or checking for parse errors.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNoQuint specification source code (.qnt content)
file_pathNoPath to a .qnt file on disk

Implementation Reference

  • The implementation of the 'quint_parse' tool, which takes a source string and file path, runs the quint parse command, and returns the resulting IR JSON.
    server.tool(
      "quint_parse",
      "Parse a Quint spec and return the intermediate representation (IR) as JSON. Useful for inspecting the AST or checking for parse errors.",
      sourceSchema,
      async ({ source, file_path }) => {
        try {
          const outFile = join(
            tmpdir(),
            `quint_ir_${randomBytes(8).toString("hex")}.json`,
          );
          const result = await runWithSource(source, file_path, (f) => [
            "parse",
            `--out=${outFile}`,
            f,
          ]);
    
          if (result.ok) {
            try {
              const ir = await readFile(outFile, "utf-8");
              await unlink(outFile).catch(() => {});
              return { content: [{ type: "text", text: ir }] };
            } catch {
              return formatResult(result);
            }
          }
    
          await unlink(outFile).catch(() => {});
          return formatResult(result);
        } catch (err) {
          return {
            content: [{ type: "text", text: `Error: ${err.message}` }],
            isError: true,
          };
        }
      },
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dpdanpittman/mcp-server-quint'

If you have feedback or need assistance with the MCP directory API, please join our Discord server