Releases: speakeasy-api/gram
@gram/[email protected]
Patch Changes
- 660c110: Support variations on any tool type. Allows the names of Custom Tools to now be edited along with all fields of Functions.
@gram-ai/[email protected]
Patch Changes
- 8675163: Adjust fs.cp filter so scaffolding works
@gram/[email protected]
@gram/[email protected]
@gram/[email protected]
Minor Changes
- 9df917a: Adds the ability for users of private servers to load the install page for easy user install of MCPs.
Patch Changes
- 3fa88db: Allow PCRE regex on incoming JSON sources, despite not necessarily being supported by Go's native regexp parsing.
- f15d1fe: Implements the boilerplate of being able to parse openIdConnect securitySchemes and treat the accessToken produced as a possible implementation of MCP OAuth
- 9df917a: fix: update to use mcpb instead of dxt nomenclature for MCP installation pages
@gram/[email protected]
@gram/[email protected]
@gram/[email protected]
@gram/[email protected]
Minor Changes
-
806beca: Introducing support for Gram Functions as part of deployments. As part of deployment processing, each function attached to a deployment will have a Fly.io app created for it which will eventually receive tool calls from the Gram server.
What are Gram Functions?
Gram Functions are serverless functions that are exposed as LLM tools to be used in your toolsets and MCP servers. They can execute any arbitrary code and make the result available to LLMs. This allows you to go far beyond what is possible with today's OpenAPI artifacts alone
At its code, a Gram Function is zip file containing at least two files:
manifest.jsonandfunctions.ts.manifest.jsonThis is a JSON file describing the tools including their names, descriptions, input schemas and any environment variables they require. For example:
{ "version": "0.0.0", "tools": [ { "name": "add", "description": "Add two numbers", "inputSchema": { "type": "object", "properties": { "a": { "type": "number" }, "b": { "type": "number" } }, "required": ["a", "b"] } }, { "name": "square_root", "description": "Calculate the square root of a number", "inputSchema": { "type": "object", "properties": { "a": { "type": "number" } }, "required": ["a"] } } ] }functions.js/functions.tsA JavaScript or TypeScript file exporting the actual function implementation for tool calls. Here's a function that implements the manifest above:
function json(value: unknown) { return new Response(JSON.stringify(value), { headers: { "Content-Type": "application/json" }, }); } export async function handleToolCall({ name, input }) { // process.env will also containe any environment variables passed on from // Gram. switch (name) { case "add": return json({ value: input.a + input.b }); case "square_root": return json({ value: Math.sqrt(input.a) }); default: throw new Error(`Unknown tool: ${name}`); } }
Notably:
- The file must export an async function called
handleToolCallwhich takes the tool name and input object as parameters. - This function must return a
Responseobject. - You can use any npm packages you like but you must ensure they are included in the zip file.
What is currently supported?
- We currently only support TypeScript/JavaScript functions and deploy them into small Firecracker microVMs running Node.js v22.
- Each function zip file must be a little under 750KiB in size or less than 1MiB when encoded in base64.
- Third-party dependencies are supported but you must decide how to include in zip archives. You may bundle everything into a single file or include a
package.jsonand node_modules directory in the zip file. As long as the total size is under the limit, it should work. - The code will be deployed into
/var/taskin the microVM. - The code will only have permission to write to
/tmp. - The code must not depend on data persisting to disk between successive tool calls.
- The file must export an async function called
-
104896e: Support tool calling to Gram Functions. This now means that you can deploy
javascript/typescript code to Gram and expose it as tools in your MCP servers.
This code runs in a secure sandbox on fly.io and allows you to run arbitrary
that performs all sorts of tasks.
Patch Changes
- c88b97f: Trim slugs to comply with 128-character limits.
- d8bd8c1: Restore security for HTTP tools in the MCP tool calling handler
- 143d76e: A database migration to support Gram Functions is added which includes:
- A new table called
fly_appsto store details about provisioned fly.io apps. - Columns in both
projectsanddeployments_functionstables that allow pinning to a specific version of the Gram Functions runner.
- A new table called
@gram/[email protected]
Patch Changes
- 3001e53: Fix the entrypoint script for Gram Functions runner images to correctly invoke the desired command with its arguments.