Skip to main content
Glama
TylerIlunga

Procore MCP Server

Show Server Configuration

procore_get_config
Read-onlyIdempotent

Retrieve current MCP server configuration including OAuth status, company ID, and project ID to debug context issues or verify settings before switching projects.

Instructions

Show the current MCP server configuration: OAuth/auth status, default company_id, the active runtime project_id, and other persisted settings. Use this to debug context issues or before switching projects. Takes no inputs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for the procore_get_config tool. Reads runtime config and auth tokens, then formats a human-readable summary of the MCP server configuration state.
    export async function handleGetConfig(): Promise<string> {
      const runtimeConfig = getRuntimeConfig();
      const tokens = readTokens();
    
      const lines: string[] = ["## Procore MCP Server Configuration\n"];
    
      // Auth status
      if (tokens) {
        const expired = isTokenExpired(tokens);
        lines.push(
          `Auth: ${expired ? "Token expired (will auto-refresh on next call)" : "Authenticated"}`
        );
        const expiresAt = new Date(tokens.expires_at).toISOString();
        lines.push(`Token expires: ${expiresAt}`);
      } else {
        lines.push("Auth: Not authenticated. Run `npm run auth` to set up.");
      }
    
      // Company ID
      const companyId =
        runtimeConfig.company_id || process.env.PROCORE_COMPANY_ID;
      lines.push(
        `\nDefault Company ID: ${companyId || "Not set"}`
      );
    
      // Runtime overrides
      if (runtimeConfig.project_id) {
        lines.push(`Default Project ID: ${runtimeConfig.project_id}`);
      }
    
      // Additional runtime config
      const otherKeys = Object.keys(runtimeConfig).filter(
        (k) => k !== "company_id" && k !== "project_id"
      );
      if (otherKeys.length > 0) {
        lines.push("\nRuntime config:");
        for (const key of otherKeys) {
          lines.push(`  ${key}: ${runtimeConfig[key]}`);
        }
      }
    
      lines.push(
        "\nUse procore_set_config to change runtime settings (company_id, project_id)."
      );
    
      return lines.join("\n");
    }
  • Registers the 'procore_get_config' tool with the MCP server, defining its title, description, empty inputSchema, and linking to the handleGetConfig handler.
    // 6. Get Config
    server.registerTool(
      "procore_get_config",
      {
        title: "Show Server Configuration",
        description:
          "Show the current MCP server configuration: OAuth/auth status, default " +
          "company_id, the active runtime project_id, and other persisted settings. " +
          "Use this to debug context issues or before switching projects. Takes no inputs.",
        inputSchema: {},
        annotations: { title: "Show Config", ...READ_ONLY },
      },
      async () => {
        const text = await handleGetConfig();
        return { content: [{ type: "text" as const, text }] };
      }
    );
  • Input schema for procore_get_config — defined as empty object (takes no inputs).
    inputSchema: {},
    annotations: { title: "Show Config", ...READ_ONLY },
  • Runtime config store used by handleGetConfig: getRuntimeConfig() returns the in-memory config (company_id, project_id, etc.) that is read to display configuration.
    let runtimeConfig: Record<string, string | number> = {};
    
    export function getRuntimeConfig(): Record<string, string | number> {
      return { ...runtimeConfig };
    }
  • readTokens() and isTokenExpired() helpers used by handleGetConfig to display OAuth authentication status and token expiry.
    export function readTokens(): TokenData | null {
      const tokenPath = getTokenPath();
      try {
        const raw = readFileSync(tokenPath, "utf8");
        const data = JSON.parse(raw) as TokenData;
        if (!data.access_token || !data.refresh_token || !data.expires_at) {
          return null;
        }
        return data;
      } catch {
        return null;
      }
    }
    
    export function writeTokens(tokens: TokenData): void {
      const tokenPath = getTokenPath();
      const dir = dirname(tokenPath);
      mkdirSync(dir, { recursive: true, mode: 0o700 });
    
      // Atomic write: write to temp file, then rename
      const tmpPath = tokenPath + ".tmp";
      writeFileSync(tmpPath, JSON.stringify(tokens, null, 2), {
        mode: 0o600,
      });
      renameSync(tmpPath, tokenPath);
    }
    
    export function isTokenExpired(tokens: TokenData): boolean {
      // 60-second buffer before actual expiry
      return Date.now() >= tokens.expires_at - 60_000;
    }
    
    export function tokensExist(): boolean {
      return readTokens() !== null;
    }
Behavior4/5

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

Annotations provide readOnlyHint, destructiveHint, idempotentHint. Description adds specific context about what settings are shown (OAuth/auth, company_id, project_id). No contradictions; adds useful detail beyond annotations.

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?

Two sentences: first lists contents, second gives usage guidance. Front-loaded, no wasted words. Perfectly concise.

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

Completeness5/5

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

For a tool with no parameters and thorough annotations, the description fully covers what it does, what it shows, and when to use it. No output schema, but the result is adequately described.

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

Parameters4/5

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

Input schema has no parameters; description confirms 'Takes no inputs.' Schema coverage is 100%, so baseline is 4. Description adds no further param info, but none needed.

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?

Clearly states it shows current MCP server configuration, listing specific items (OAuth/auth status, default company_id, active runtime project_id, other persisted settings). Distinct from all sibling tools which create, update, or delete resources.

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

Usage Guidelines5/5

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

Explicitly tells when to use it: 'Use this to debug context issues or before switching projects.' Also states it takes no inputs, which guides usage.

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/TylerIlunga/procore-mcp-server'

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