Skip to content

Commit 25c8aa4

Browse files
committed
Sync open source content 🐝 (from 8e46d12bc34acf2647539e8319fbe88929f6d575)
1 parent 43aa914 commit 25c8aa4

File tree

2 files changed

+51
-8
lines changed

2 files changed

+51
-8
lines changed

_meta.global.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const meta = {
9999
title: "Using the MCP SDK",
100100
},
101101
"build-deploy": {
102-
title: "Deploy as MCP",
102+
title: "Build and Deploy",
103103
},
104104
},
105105
},

docs/gram/getting-started/typescript.mdx

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,44 @@ description: "Learn how to create and deploy an MCP server using Gram's TypeScri
55

66
import { Callout } from "@/mdx/components";
77

8-
Welcome! This guide will walk you through the process of creating tools and a MCP server using Gram Functions.
9-
Gram Functions allows you to deploy completely isolated tool call environments that can then be exposed as MCP servers.
8+
When you need to build tools with custom business logic, data transformations,
9+
or multi-step workflows, Gram Functions provides a TypeScript framework for
10+
creating serverless functions that can be exposed as MCP server tools. Unlike
11+
OpenAPI-sourced tools which simply wrap existing API endpoints, Gram Functions
12+
allow you to write custom code that executes in isolated environments.
1013

11-
```typescript filename="gram.ts"
14+
Gram Functions-sourced MCP tools are ideal for the following use cases:
15+
16+
- **Custom business logic**: Implement complex calculations, data processing,
17+
or decision-making logic that goes beyond simple API calls. For example,
18+
aggregating data from multiple sources or applying custom validation rules.
19+
- **Data transformations**: Transform, filter, or enrich data before returning
20+
it to LLM clients. For example, parsing and summarizing large datasets or
21+
converting between data formats.
22+
- **Multi-step workflows**: Orchestrate multiple API calls or operations in a
23+
single tool. For example, creating a tool that searches for data, processes
24+
it, and then stores the results.
25+
26+
This guide walks through the steps of building an MCP server with Gram
27+
Functions. This includes:
28+
29+
- Creating a new Gram Functions project,
30+
- Writing custom tools with TypeScript,
31+
- Deploying your functions to Gram, and
32+
- Creating an MCP server from your tools.
33+
34+
## Before you start
35+
36+
This guide assumes that you have already done the following:
37+
38+
- Created a [Gram account](https://app.getgram.ai),
39+
- Created a Gram project (accomplished during onboarding), and
40+
- Installed Node.js version >=22.18.0.
41+
42+
<Callout title="Quick Example" type="info">
43+
Here's a simple example of a Gram Function that greets a user:
44+
45+
```typescript
1246
import { Gram } from "@gram-ai/functions";
1347
import * as z from "zod/mini";
1448

@@ -23,14 +57,15 @@ const gram = new Gram().tool({
2357

2458
export default gram;
2559
```
60+
</Callout>
2661

2762
## Step 1: Create a project
2863

2964
Gram offers a bootstrapper through `npm/pnpm create` to create a new project.
3065

3166
<Callout title="Note" type="info">
3267
Gram Functions currently requires a node version >=22.18.0
33-
</Callout>
68+
</Callout>
3469

3570
```bash
3671
npm create @gram-ai/function
@@ -79,9 +114,9 @@ export default gram;
79114
```
80115

81116
<Callout title="Note" type="info">
82-
You are not necessarily building an MCP server here. Write whatever tools you want--you will later be able
117+
You are not necessarily building an MCP server here. Write whatever tools you want--you will later be able
83118
to slice and dice them into MCP servers or combine them with other types of tools into existing MCP servers.
84-
</Callout>
119+
</Callout>
85120

86121
## Step 3: Build and deploy
87122

@@ -109,4 +144,12 @@ Now, click **Add Tools** to add your tools to the toolset. You'll see the tools
109144

110145
![Gram Dashboard, showing the add tools dialog](/assets/docs/gram/img/functions/onboarding_add-tools.png)
111146

112-
Finally, head to the **MCP** tab on the toolset page and click **Enable**. Check out the **Install Page** linked therein for help installing the MCP server in your favorite client. For more information on MCP servers, see the [MCP Servers](/docs/gram/host-mcp/deploy-mcp-server) documentation.
147+
Finally, head to the **MCP** tab on the toolset page and click **Enable**. Check out the **Install Page** linked therein for help installing the MCP server in your favorite client. For more information on MCP servers, see the [MCP Servers](/docs/gram/host-mcp/deploy-mcp-server) documentation.
148+
149+
## What's next?
150+
151+
The following resources will help you get the most out of your Gram MCP server:
152+
153+
- [Learn more about the Gram Functions framework.](/docs/gram/gram-functions/introduction)
154+
- [Learn about best practices for curating toolsets.](/docs/gram/build-mcp/advanced-tool-curation)
155+
- [Add OpenAPI-sourced tools to your MCP server.](/docs/gram/getting-started/openapi)

0 commit comments

Comments
 (0)