<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2026"
  xmlns:ffd="http://xbrl.sec.gov/ffd/2026"
  xmlns:iso4217="http://www.xbrl.org/2003/iso4217"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xbrldi="http://xbrl.org/2006/xbrldi"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef
      xlink:href="https://xbrl.sec.gov/ffd/2026/ffd-2026.xsd"
      xlink:type="simple"/>
    <context id="c0">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000847411</identifier>
        </entity>
        <period>
            <startDate>2026-05-13</startDate>
            <endDate>2026-05-13</endDate>
        </period>
    </context>
    <context id="c1">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000847411</identifier>
            <segment>
                <xbrldi:typedMember dimension="ffd:OfferingAxis">
                    <dei:lineNo>1</dei:lineNo>
                </xbrldi:typedMember>
            </segment>
        </entity>
        <period>
            <startDate>2026-05-13</startDate>
            <endDate>2026-05-13</endDate>
        </period>
    </context>
    <unit id="usd">
        <measure>iso4217:USD</measure>
    </unit>
    <ffd:PrevslyPdFlg contextRef="c1" id="ixv-47">true</ffd:PrevslyPdFlg>
    <ffd:TxValtn contextRef="c1" decimals="2" id="ixv-211" unitRef="usd">34457632.01</ffd:TxValtn>
    <ffd:FeeAmt contextRef="c1" decimals="2" id="ixv-212" unitRef="usd">4758.6</ffd:FeeAmt>
    <ffd:TtlTxValtn contextRef="c0" decimals="2" id="ixv-213" unitRef="usd">34457632.01</ffd:TtlTxValtn>
    <ffd:TtlFeeAmt contextRef="c0" decimals="2" id="ixv-214" unitRef="usd">4758.6</ffd:TtlFeeAmt>
    <ffd:TtlPrevslyPdAmt contextRef="c0" decimals="2" id="ixv-215" unitRef="usd">4758.6</ffd:TtlPrevslyPdAmt>
    <ffd:TtlOffsetAmt contextRef="c0" decimals="2" id="ixv-216" unitRef="usd">0</ffd:TtlOffsetAmt>
    <ffd:NetFeeAmt contextRef="c0" decimals="2" id="ixv-217" unitRef="usd">0</ffd:NetFeeAmt>
    <ffd:OfferingNote contextRef="c1" id="ixv-101">&lt;p style="font: 12pt Arial, Helvetica, Sans-Serif; margin: 0pt 0; "&gt;(1) Calculated as the aggregate maximum
purchase price for Shares that could be purchased, based upon the shares outstanding and 99% of the net asset value of the Trust
rounded to four decimal places as of April 6, 2026.&lt;/p&gt;</ffd:OfferingNote>
    <ffd:FeeExhibitTp contextRef="c0" id="hidden-fact-0">EX-FILING FEES</ffd:FeeExhibitTp>
    <dei:EntityCentralIndexKey contextRef="c0" id="ixv-221">0000847411</dei:EntityCentralIndexKey>
    <dei:EntityRegistrantName contextRef="c0" id="ixv-222">MFS INVESTMENT GRADE MUNICIPAL TRUST</dei:EntityRegistrantName>
    <ffd:FormTp contextRef="c0" id="ixv-223">SC TO</ffd:FormTp>
    <ffd:OffsetTableNa contextRef="c0" id="ixv-224">N/A</ffd:OffsetTableNa>
    <ffd:SubmissnTp contextRef="c0" id="ixv-225">SC TO-I/A</ffd:SubmissnTp>
</xbrl>
