Skip to main content
Glama

New Heim Application

new_heim_application

Generate backend applications from OpenAPI specifications using the Heim framework, supporting Rust and CSharp languages with customizable project settings.

Instructions

Runs 'heim new' command on your local computer to create application schafholding from an OpenAPI 3.0.1 specification.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute windows path to the folder where the project should be created. The created project will be under this path with a folder name called 'name'. The code to modify will be under <PATH>/<NAME>/src/ and the heim folder within shouldn't be modified.
openApiPathYesAbsolute windows path to OpenAPI file. The schema requires operationId and a full list of what Heim supports of the OpenAPI schema can be found here: https://cloud.heim.dev/heim/docs/templates/openapi/#openapi-root-object
nameYesThe name of the application. This will be used to name the application folder and set the name in the application.toml file.
languageYesThe programming language you want to use for creating an application from an OpenAPI specification. Currently Rust and CSharp are supported.
versionNoThe version number it will set for the application in SemVer format. Defaults to `0.1.0`.0.1.0
basePathNoThe base path added bafore the path in the OpenAPI schema. Defaults to not adding a base path./
overwriteNoShould the new application overwrite an existing folder if it already exists? Defaults to `false`.

Implementation Reference

  • The handler function for the 'new_heim_application' tool. It executes the 'heim new' command with provided parameters to scaffold a new Heim application from an OpenAPI specification and then builds the project using cargo or dotnet.
    async (request) => {
      const execPromise = util.promisify(exec);
      try {
        const { stdout, stderr } = await execPromise(
          `heim new --path ${request.path} --spec ${
            request.openApiPath
          } --name ${request.name} --version ${request.version} --language ${
            request.language
          } --base-path ${request.basePath}  ${
            request.overwrite ? "--force" : ""
          }`
        );
    
        const output2 = await execPromise(
          request.language == "rust"
            ? `cargo build --manifest-path ${request.path}/${request.name}/Cargo.toml --target wasm32-wasip2`
            : `dotnet build ${request.path}/${request.name}/${request.name}.csproj`
        );
    
        return {
          content: [
            {
              type: "text",
              text: `new stdout:\n${stdout}\nbuild stdout:${output2.stdout}\nnew stderr:\n${stderr}\nbuild stdout:${output2.stdout}`,
            },
          ],
        };
      } catch (err: any) {
        return {
          content: [{ type: "text", text: `Error: ${err.message}` }],
          isError: true,
        };
      }
    }
  • Zod-based input schema defining parameters for the 'new_heim_application' tool: path, openApiPath, name, language, version, basePath, overwrite.
    inputSchema: {
      path: z
        .string()
        .describe(
          "Absolute windows path to the folder where the project should be created. The created project will be under this path with a folder name called 'name'. The code to modify will be under <PATH>/<NAME>/src/ and the heim folder within shouldn't be modified."
        ),
      openApiPath: z
        .string()
        .describe(
          "Absolute windows path to OpenAPI file. The schema requires operationId and a full list of what Heim supports of the OpenAPI schema can be found here: https://cloud.heim.dev/heim/docs/templates/openapi/#openapi-root-object"
        ),
      name: z
        .string()
        .describe(
          "The name of the application. This will be used to name the application folder and set the name in the application.toml file."
        ),
      language: z
        .union([z.literal("rust"), z.literal("csharp")])
        .describe(
          "The programming language you want to use for creating an application from an OpenAPI specification. Currently Rust and CSharp are supported."
        ),
      version: z
        .string()
        .default("0.1.0")
        .describe(
          "The version number it will set for the application in SemVer format. Defaults to `0.1.0`."
        ),
      basePath: z
        .string()
        .default("/")
        .describe(
          "The base path added bafore the path in the OpenAPI schema. Defaults to not adding a base path."
        ),
      overwrite: z
        .boolean()
        .default(false)
        .describe(
          "Should the new application overwrite an existing folder if it already exists? Defaults to `false`."
        ),
    },
  • src/tools.ts:8-95 (registration)
    Registration of the 'new_heim_application' tool using server.registerTool, including schema and handler function.
    server.registerTool(
      "new_heim_application",
      {
        title: "New Heim Application",
        description:
          "Runs 'heim new' command on your local computer to create application schafholding from an OpenAPI 3.0.1 specification.",
        inputSchema: {
          path: z
            .string()
            .describe(
              "Absolute windows path to the folder where the project should be created. The created project will be under this path with a folder name called 'name'. The code to modify will be under <PATH>/<NAME>/src/ and the heim folder within shouldn't be modified."
            ),
          openApiPath: z
            .string()
            .describe(
              "Absolute windows path to OpenAPI file. The schema requires operationId and a full list of what Heim supports of the OpenAPI schema can be found here: https://cloud.heim.dev/heim/docs/templates/openapi/#openapi-root-object"
            ),
          name: z
            .string()
            .describe(
              "The name of the application. This will be used to name the application folder and set the name in the application.toml file."
            ),
          language: z
            .union([z.literal("rust"), z.literal("csharp")])
            .describe(
              "The programming language you want to use for creating an application from an OpenAPI specification. Currently Rust and CSharp are supported."
            ),
          version: z
            .string()
            .default("0.1.0")
            .describe(
              "The version number it will set for the application in SemVer format. Defaults to `0.1.0`."
            ),
          basePath: z
            .string()
            .default("/")
            .describe(
              "The base path added bafore the path in the OpenAPI schema. Defaults to not adding a base path."
            ),
          overwrite: z
            .boolean()
            .default(false)
            .describe(
              "Should the new application overwrite an existing folder if it already exists? Defaults to `false`."
            ),
        },
        annotations: {
          destructiveHint: false,
          readOnlyHint: false,
          idempotentHint: false,
          openWorldHint: false,
        },
      },
      async (request) => {
        const execPromise = util.promisify(exec);
        try {
          const { stdout, stderr } = await execPromise(
            `heim new --path ${request.path} --spec ${
              request.openApiPath
            } --name ${request.name} --version ${request.version} --language ${
              request.language
            } --base-path ${request.basePath}  ${
              request.overwrite ? "--force" : ""
            }`
          );
    
          const output2 = await execPromise(
            request.language == "rust"
              ? `cargo build --manifest-path ${request.path}/${request.name}/Cargo.toml --target wasm32-wasip2`
              : `dotnet build ${request.path}/${request.name}/${request.name}.csproj`
          );
    
          return {
            content: [
              {
                type: "text",
                text: `new stdout:\n${stdout}\nbuild stdout:${output2.stdout}\nnew stderr:\n${stderr}\nbuild stdout:${output2.stdout}`,
              },
            ],
          };
        } catch (err: any) {
          return {
            content: [{ type: "text", text: `Error: ${err.message}` }],
            isError: true,
          };
        }
      }
    );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate this is not read-only, not open-world, not idempotent, and not destructive. The description adds useful context about creating a project folder and not modifying the heim folder, which goes beyond annotations. However, it doesn't mention potential side effects like file system changes or error conditions, leaving some behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently conveys the core purpose without unnecessary words. It's front-loaded with the main action and resource, making it easy to understand at a glance. Every word serves a clear purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 7 parameters, 100% schema coverage, and no output schema, the description provides sufficient context about what the tool does and its basic behavior. It could be more complete by mentioning the tool's effect on the local file system or potential errors, but it adequately covers the main purpose given the rich schema support.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the schema fully documents all 7 parameters. The description doesn't add any parameter-specific details beyond what's in the schema. The baseline score of 3 reflects adequate coverage through the schema alone, with no additional value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Runs heim new command'), the resource ('create application scaffolding'), and the source ('from an OpenAPI 3.0.1 specification'). It distinguishes itself from siblings like deploy_heim_application and heim_update by focusing on initial creation rather than deployment or updating.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for initial application creation from an OpenAPI spec, suggesting usage when starting a new project. However, it doesn't explicitly state when to use this versus alternatives like heim_update for existing projects, nor does it mention prerequisites or exclusions. The context is clear but lacks explicit guidance on alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Nor2-io/heim-mcp'

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