Skip to main content
Glama

generate-project-files

Create starter files for new React Native Expo Router projects with navigation layouts, Zustand store, API client, NativeWind config, TypeScript setup, and sample screens.

Instructions

Generate starter files for a NEW React Native + Expo Router project. Produces actual file contents: navigation layouts, Zustand store, API client, NativeWind config, TypeScript config, and sample screens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNameYesApp name
featuresNoList of features (e.g. ["auth", "catalog", "cart"])
includeCINoInclude GitHub Actions CI/CD

Implementation Reference

  • The main handler function `generateProjectFiles` that orchestrates the creation of all required project files based on provided options.
    export function generateProjectFiles(options: ProjectFilesOptions): string {
      const {
        appName,
        features = [],
        includeCI = false,
        includeEnvSetup = true,
      } = options;
    
      const files: GeneratedFile[] = [];
    
      // Common files
      files.push(...getCommonFiles(appName));
    
      // tsconfig.json with path aliases
      files.push(getTsConfig());
    
      // Expo Router files
      files.push(...getExpoRouterFiles(appName, features));
    
      // Store files
      files.push(...getStoreFiles());
    
      // API files
      files.push(...getApiFiles());
    
      // Env setup
      if (includeEnvSetup) {
        files.push(...getEnvFiles(appName));
      }
    
      // CI/CD
      if (includeCI) {
        files.push(...getCIFiles());
      }
    
      // Format output
      const output = files
        .map((f) => `## ${f.path}\n\`\`\`${getExt(f.path)}\n${f.content}\n\`\`\``)
        .join("\n\n");
    
      const cleanupInstructions = `## Cleanup Template Files
    
    If your project was created from a template with example files, remove them:
    
    \`\`\`bash
    rm -f "app/(tabs)/two.tsx" app/modal.tsx app/+html.tsx
    rm -f components/EditScreenInfo.tsx components/StyledText.tsx components/Themed.tsx
    rm -f constants/Colors.ts
    \`\`\`
    
    Update \`app/+not-found.tsx\` — replace any \`@/components/Themed\` import with standard \`react-native\`:
    \`\`\`tsx
    import { Text, View } from 'react-native';
    \`\`\``;
    
      return `# Starter Files for ${appName} (Expo Router)
    
    Create the following files in your project:
    
    ${output}
    
    ${cleanupInstructions}
    
    ---
    
    After creating the files:
    \`\`\`bash
    npx expo install babel-plugin-module-resolver babel-plugin-react-compiler
    npm install
    npx expo prebuild --clean
    npx expo run:ios     # or npx expo run:android
    \`\`\`
    
    > **Note:** This project uses \`react-native-mmkv\` — a native module that does **not work in Expo Go**. You need \`expo prebuild\` to generate native projects (ios/android folders), then run via \`expo run:ios\` / \`expo run:android\`.
    `;
    }
  • src/index.ts:271-297 (registration)
    Registration of the `generate-project-files` tool in the MCP server, including input schema validation and handler invocation.
    server.tool(
      "generate-project-files",
      "Generate starter files for a NEW React Native + Expo Router project. Produces actual file contents: navigation layouts, Zustand store, API client, NativeWind config, TypeScript config, and sample screens.",
      {
        appName: z.string().describe("App name"),
        features: z
          .array(z.string())
          .optional()
          .describe('List of features (e.g. ["auth", "catalog", "cart"])'),
        includeCI: z
          .boolean()
          .default(false)
          .describe("Include GitHub Actions CI/CD"),
      },
      async ({ appName, features, includeCI }) => {
        const content = generateProjectFiles({
          appName,
          router: "expo-router",
          features,
          includeCI,
          includeEnvSetup: true,
        });
        return {
          content: [{ type: "text", text: content }],
        };
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool 'Produces actual file contents' but lacks details on behavioral traits like whether it overwrites existing files, requires specific permissions, or has side effects. This is inadequate for a file-generation tool with no annotation coverage.

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 front-loaded with the main purpose and efficiently lists the generated file types in a single sentence. Every part adds value without redundancy, making it appropriately sized and easy to scan.

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

Completeness3/5

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

Given the tool's complexity (file generation with 3 parameters) and lack of annotations and output schema, the description is somewhat complete but has gaps. It specifies what files are generated but not the output format or potential errors. It's adequate but could benefit from more behavioral context.

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?

Schema description coverage is 100%, so the schema already documents all parameters. The description does not add meaning beyond the schema, such as explaining how 'features' map to generated files or what 'includeCI' entails. Baseline 3 is appropriate when the schema handles parameter documentation.

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 tool's purpose with specific verbs ('Generate starter files') and resources ('React Native + Expo Router project'), and it distinguishes from siblings by focusing on file generation rather than pattern retrieval or project setup. It lists the specific file types produced, making the scope explicit.

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

Usage Guidelines4/5

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

The description implies usage for a 'NEW' project, providing clear context for when to use it. However, it does not explicitly state when not to use it or name alternatives among siblings, such as 'setup-new-project', which might have overlapping functionality.

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/ZaharGusyatin/react-native-expo-mcp'

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